Skip to content

Commit

Permalink
feat: add logging to admin-form.controller
Browse files Browse the repository at this point in the history
  • Loading branch information
wanlingt committed Aug 11, 2023
1 parent 9c490f3 commit d09ba21
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/app/modules/form/admin-form/admin-form.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,18 @@ export const _handleUpdateWebhookSettings: ControllerHandler<
const { userEmail } = req.body
const settingsToPatch = req.body

logger.info({
message: 'User attempting to update webhook settings',
meta: {
action: '_handleUpdateWebhookSettings',
...createReqMeta(req),
reqBody: req.body,
formId,
userEmail,
settingsToPatch,
},
})

// Step 1: Retrieve currently logged in user.
return UserService.findUserByEmail(userEmail)
.andThen((user) =>
Expand Down Expand Up @@ -1502,6 +1514,17 @@ export const handleGetWebhookSettings: ControllerHandler<
const { formId } = req.params
const { userEmail } = req.body

logger.info({
message: 'User attempting to get webhook settings',
meta: {
action: 'handleGetWebhookSettings',
...createReqMeta(req),
reqBody: req.body,
formId,
userEmail,
},
})

return UserService.findUserByEmail(userEmail)
.andThen((user) =>
// Retrieve form for settings as well as for permissions checking
Expand Down

0 comments on commit d09ba21

Please sign in to comment.