diff --git a/backend/src/components/application.js b/backend/src/components/application.js index ed4c2a78..5c925057 100644 --- a/backend/src/components/application.js +++ b/backend/src/components/application.js @@ -376,11 +376,11 @@ async function submitApplication(req, res) { const ccfriFacilitiesToLock = JSON.parse(JSON.stringify(declaration)); declaration = declaration.toJSON(); try { - printPdf(req).then(); - delete declaration.facilities; let response = await patchOperationWithObjectId('ccof_applications', req.params.applicationId, declaration); + await printPdf(req).then(); + // If CCRFI facilities exist on the payload we need to iterate // each and call CCFRI endpoint to relock attributes. if (checkKey('facilities', ccfriFacilitiesToLock)) {