Skip to content

Commit

Permalink
Merge pull request #483 from bandada-infra/fix/api-sdk
Browse files Browse the repository at this point in the history
Missing `return` statements for removeGroup(s) API SDK methods
  • Loading branch information
vplasencia authored Apr 9, 2024
2 parents 44662c4 + 7949851 commit a1a8bc1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions apps/api/src/app/groups/groups.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion libs/api-sdk/src/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export async function updateGroups(
apiKey: string
): Promise<Array<Group>> {
const newConfig: any = {
method: "put",
method: "patch",
data: {
groupIds,
groupsInfo: groupsUpdateDetails
Expand Down

0 comments on commit a1a8bc1

Please sign in to comment.