chore(server/logging): add operations logging to notifications module

This commit is contained in:
Iain Sproat
2025-04-15 07:57:51 +01:00
parent 30e39ccb01
commit 71111429b8
@@ -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
}
}