Skip to content

Commit

Permalink
chore: add logs to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin9foong committed Jan 13, 2025
1 parent 1b6d1f8 commit 43ffa90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/src/features/admin-form/settings/SettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ const updateFormSettings = async (
// TODO: update this to work with backend
export const updateFormWhitelistSetting: UpdateStorageFormWhitelistSettingFn =
async (formId: string, whitelistCsvString: Promise<string> | null) => {
const whitelistCsvStringString = await whitelistCsvString
console.log('updating whitelist setting:', formId, whitelistCsvStringString)
return ApiService.putForm<FormSettings>(
`${ADMIN_FORM_ENDPOINT}/${formId}/settings/whitelist`,
{
Expand Down
10 changes: 10 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 @@ -1791,9 +1791,19 @@ const _handleUpdateWhitelistSetting: ControllerHandler<
export const _handleUpdateWhitelistSettingForTest =
_handleUpdateWhitelistSetting

const loggerMiddleware = async (req, res, next) => {
console.log('request:', req)
console.log('response:', res)

next()
}

export const handleUpdateWhitelistSetting = [
loggerMiddleware,
handleWhitelistSettingMultipartBody.none(), // expecting string field
loggerMiddleware,
_handleUpdateWhitelistSettingValidator,
loggerMiddleware,
_handleUpdateWhitelistSetting,
] as ControllerHandler[]

Expand Down

0 comments on commit 43ffa90

Please sign in to comment.