1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-06 01:15:28 +02:00

refactor: contract event group deleted after #4816 (#4817)

As mentioned in
https://github.com/Unleash/unleash/pull/4816#discussion_r1334162284
This commit is contained in:
Nuno Góis 2023-09-22 12:57:09 +01:00 committed by GitHub
parent b6b0f83e3d
commit 91edae3ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,19 +170,17 @@ export class GroupService {
return []; return [];
} }
async deleteGroup(id: number, userName?: string): Promise<void> { async deleteGroup(id: number, userName: string): Promise<void> {
const group = await this.groupStore.get(id); const group = await this.groupStore.get(id);
await this.groupStore.delete(id); await this.groupStore.delete(id);
if (userName) {
await this.eventStore.store({ await this.eventStore.store({
type: GROUP_DELETED, type: GROUP_DELETED,
createdBy: userName, createdBy: userName,
data: group, data: group,
}); });
} }
}
async validateGroup( async validateGroup(
group: IGroupModel | ICreateGroupModel, group: IGroupModel | ICreateGroupModel,