From 79498512e95211e5ca88ffcbeffe3fca17c38e39 Mon Sep 17 00:00:00 2001 From: Jeeiii Date: Tue, 9 Apr 2024 18:55:35 +0200 Subject: [PATCH] fix: missing return statement for removeGroup(s) API SDK method --- apps/api/src/app/groups/groups.controller.ts | 23 +++++++++++++++----- libs/api-sdk/src/groups.ts | 2 +- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/apps/api/src/app/groups/groups.controller.ts b/apps/api/src/app/groups/groups.controller.ts index 0d32772..73a32b7 100644 --- a/apps/api/src/app/groups/groups.controller.ts +++ b/apps/api/src/app/groups/groups.controller.ts @@ -120,14 +120,20 @@ export class GroupsController { if (apiKey) { await this.groupsService.removeGroupsWithAPIKey(groupIds, apiKey) - } else if (req.session.adminId) { + + return + } + + if (req.session.adminId) { await this.groupsService.removeGroupsManually( groupIds, req.session.adminId ) - } else { - throw new NotImplementedException() + + return } + + throw new NotImplementedException() } @Delete(":group") @@ -145,14 +151,19 @@ export class GroupsController { if (apiKey) { await this.groupsService.removeGroupWithAPIKey(groupId, apiKey) - } else if (req.session.adminId) { + + return + } + if (req.session.adminId) { await this.groupsService.removeGroupManually( groupId, req.session.adminId ) - } else { - throw new NotImplementedException() + + return } + + throw new NotImplementedException() } @Patch() diff --git a/libs/api-sdk/src/groups.ts b/libs/api-sdk/src/groups.ts index 598256f..0bdcb30 100644 --- a/libs/api-sdk/src/groups.ts +++ b/libs/api-sdk/src/groups.ts @@ -133,7 +133,7 @@ export async function updateGroups( apiKey: string ): Promise> { const newConfig: any = { - method: "put", + method: "patch", data: { groupIds, groupsInfo: groupsUpdateDetails