From e92d569759c85b84d589a92aca12f96225280057 Mon Sep 17 00:00:00 2001 From: f-w Date: Wed, 4 Dec 2024 16:23:21 -0800 Subject: [PATCH] nullish coalescing assigning dispatch.req --- src/api/notifications/notifications.controller.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/api/notifications/notifications.controller.ts b/src/api/notifications/notifications.controller.ts index 5981b419d..982df51e6 100644 --- a/src/api/notifications/notifications.controller.ts +++ b/src/api/notifications/notifications.controller.ts @@ -448,8 +448,7 @@ export class NotificationsController { data.dispatch = data.dispatch ?? {}; data.dispatch.candidates = data.dispatch.candidates ?? subCandidates.map((e) => e.id.toString()); - // todo: pick more props is needed - data.dispatch.req = pick(this.req, ['user', 'protocol', 'hostname']); + data.dispatch.req ??= pick(this.req, ['user', 'protocol', 'hostname']); await this.notificationsService.updateById( data.id, {