diff --git a/apps/backend/src/app/groups/groups.controller.ts b/apps/backend/src/app/groups/groups.controller.ts index 350dae1..e9deb0a 100644 --- a/apps/backend/src/app/groups/groups.controller.ts +++ b/apps/backend/src/app/groups/groups.controller.ts @@ -24,15 +24,20 @@ export class GroupsController { @Query("limit", new DefaultValuePipe(20), ParseIntPipe) limit: number, @Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number, @Query("search", new DefaultValuePipe("")) search: string, - ) {} + ) { + return await this.groupsService.getGroupsByName(limit, offset, search) + } - //TODO DTO @Post("new") - async newGroup() {} + async newGroup(@Body() body: CreateGroupDto) { + return await this.groupsService.newGroup(body.groupName) + } @UseGuards(AdminGuard) @Delete(":groupId") - async deleteGroup(@Param("groupId") groupId: string) {} + async deleteGroup(@Param("groupId") groupId: string) { + return await this.groupsService.deleteGroup(groupId) + } //TODO Patch @@ -42,5 +47,7 @@ export class GroupsController { @Query("offset", new DefaultValuePipe(0), ParseIntPipe) offset: number, @Query("search", new DefaultValuePipe("")) search: string, @Param("groupId") groupId: string, - ) {} + ) { + return await this.groupsService.findFilesForGroup(limit, offset, search, groupId) + } }