Skip to content

Commit

Permalink
fix: Wrong bool value for skipValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Dec 7, 2024
1 parent 96087e6 commit ea7a7a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api.planx.uk/modules/send/s3/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ const sendToS3: SendIntegrationController = async (_req, res, next) => {
const flowName = session?.flow?.name;

// Generate the ODP Schema JSON, skipping validation if not a supported application type
const doValidation = isApplicationTypeSupported(passport);
const skipValidation = !isApplicationTypeSupported(passport);
const exportData = await $api.export.digitalPlanningDataPayload(
sessionId,
doValidation,
skipValidation,
);

// Create and upload the data as an S3 file
Expand All @@ -70,7 +70,7 @@ const sendToS3: SendIntegrationController = async (_req, res, next) => {
service: flowName,
environment: env,
file: fileUrl,
payload: doValidation ? "Validated ODP Schema" : "Discretionary",
payload: skipValidation ? "Discretionary" : "Validated ODP Schema",
},
};
const webhookResponse = await axios(webhookRequest)
Expand Down Expand Up @@ -126,7 +126,7 @@ const sendToS3: SendIntegrationController = async (_req, res, next) => {

res.status(200).send({
message: `Successfully uploaded submission to S3: ${fileUrl}`,
payload: doValidation ? "Validated ODP Schema" : "Discretionary",
payload: skipValidation ? "Discretionary" : "Validated ODP Schema",
webhookResponse: webhookResponse.axiosResponse.status,
auditEntryId: webhookResponse.id,
});
Expand Down

0 comments on commit ea7a7a3

Please sign in to comment.