Skip to content

Commit

Permalink
Fix body posted to bops
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben committed Jul 5, 2023
1 parent d9e3f40 commit 946da67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api.planx.uk/send/bops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const sendToBOPS = async (req: Request, res: Response, next: NextFunction) => {
);
}
const target = `${bopsSubmissionURL}/api/v1/planning_applications`;
const bopsFullPayload = await $admin.export.bopsPayload(payload?.sessionId);
const { exportData } = await $admin.export.bopsPayload(payload?.sessionId);

try {
const bopsResponse = await axios({
Expand All @@ -60,7 +60,7 @@ const sendToBOPS = async (req: Request, res: Response, next: NextFunction) => {
"Content-Type": "application/json",
Authorization: `Bearer ${process.env.BOPS_API_TOKEN}`,
},
data: bopsFullPayload,
data: exportData,
})
.then(async (res: AxiosResponse<{ id: string }>) => {
// Mark session as submitted so that reminder and expiry emails are not triggered
Expand Down Expand Up @@ -96,7 +96,7 @@ const sendToBOPS = async (req: Request, res: Response, next: NextFunction) => {
{
bops_id: res.data.id,
destination_url: target,
request: bopsFullPayload,
request: exportData,
response: res.data,
response_headers: res.headers,
session_id: payload?.sessionId,
Expand Down

0 comments on commit 946da67

Please sign in to comment.