Skip to content

Commit c67c25d

Browse files
committed
CRUD
1 parent 7fb1ace commit c67c25d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/cdp/handleFinalizePayment.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,18 @@ export default async function handleFinalizePayment(
303303
redirect: false,
304304
}
305305
callback(null, result)
306+
307+
await dbCdpLog
308+
.set(null, {
309+
create: isCreate, // create a new access code
310+
registrationNumber: company.registrationNumber,
311+
stepIndex: 99, // last step
312+
stepName: 'payment-finalization',
313+
type: 'cdp-form-step',
314+
})
315+
.catch(err =>
316+
console.log(new Date(), `[CDP] [Finalization] Failed to add log entry for succeccful CDP payment finalization of company number ${company.registrationNumber}.`, err)
317+
)
306318
} catch (err) {
307319
// if any of them fails to save, revert both of them
308320
codeGenerated
@@ -314,18 +326,6 @@ export default async function handleFinalizePayment(
314326
throw new Error(err)
315327
}
316328

317-
await dbCdpLog
318-
.set(null, {
319-
create: isCreate, // create a new access code
320-
registrationNumber: company.registrationNumber,
321-
stepIndex: 99, // last step
322-
stepName: 'payment-finalization',
323-
type: 'cdp-form-step',
324-
})
325-
.catch(err =>
326-
console.log(new Date(), `[CDP] [Finalization] Failed to add log entry for succeccful CDP payment finalization of company number ${company.registrationNumber}.`, err)
327-
)
328-
329329
const [client] = this
330330
const {
331331
handshake: {

0 commit comments

Comments
 (0)