From 91edae3ccf5ba2c8f523ad56ca8e1d4b671da65f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20G=C3=B3is?= Date: Fri, 22 Sep 2023 12:57:09 +0100 Subject: [PATCH] refactor: contract event group deleted after #4816 (#4817) As mentioned in https://github.com/Unleash/unleash/pull/4816#discussion_r1334162284 --- src/lib/services/group-service.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/services/group-service.ts b/src/lib/services/group-service.ts index 6e2644686e..ea4e652252 100644 --- a/src/lib/services/group-service.ts +++ b/src/lib/services/group-service.ts @@ -170,18 +170,16 @@ export class GroupService { return []; } - async deleteGroup(id: number, userName?: string): Promise { + async deleteGroup(id: number, userName: string): Promise { const group = await this.groupStore.get(id); await this.groupStore.delete(id); - if (userName) { - await this.eventStore.store({ - type: GROUP_DELETED, - createdBy: userName, - data: group, - }); - } + await this.eventStore.store({ + type: GROUP_DELETED, + createdBy: userName, + data: group, + }); } async validateGroup(