From 71111429b841ee5be5f9ee4ac9917ef98cf2c2c8 Mon Sep 17 00:00:00 2001 From: Iain Sproat <68657+iainsproat@users.noreply.github.com> Date: Tue, 15 Apr 2025 07:57:51 +0100 Subject: [PATCH] chore(server/logging): add operations logging to notifications module --- .../graph/resolvers/userNotificationPreferences.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/server/modules/notifications/graph/resolvers/userNotificationPreferences.ts b/packages/server/modules/notifications/graph/resolvers/userNotificationPreferences.ts index f4f4faee7..39f9bb59a 100644 --- a/packages/server/modules/notifications/graph/resolvers/userNotificationPreferences.ts +++ b/packages/server/modules/notifications/graph/resolvers/userNotificationPreferences.ts @@ -8,6 +8,7 @@ import { getUserNotificationPreferencesFactory, updateNotificationPreferencesFactory } from '@/modules/notifications/services/notificationPreferences' +import { withOperationLogging } from '@/observability/domain/businessLogging' const getUserNotificationPreferences = getUserNotificationPreferencesFactory({ getSavedUserNotificationPreferences: getSavedUserNotificationPreferencesFactory({ @@ -28,7 +29,15 @@ export = { }, Mutation: { async userNotificationPreferencesUpdate(_parent, args, context) { - await updateNotificationPreferences(context.userId!, args.preferences) + const logger = context.log + await await withOperationLogging( + async () => updateNotificationPreferences(context.userId!, args.preferences), + { + logger, + operationName: 'userNotificationPreferencesUpdate', + operationDescription: 'Update user notification preferences' + } + ) return true } }