finished delete group api

This commit is contained in:
faris Aljohari
2024-03-12 14:11:23 +03:00
parent 1f5789db1b
commit 4cdba75367
3 changed files with 53 additions and 11 deletions
+12
View File
@@ -8,6 +8,7 @@ import {
Query,
Param,
Put,
Delete,
} from '@nestjs/common';
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
import { JwtAuthGuard } from '../../../libs/common/src/guards/jwt.auth.guard';
@@ -70,4 +71,15 @@ export class GroupController {
throw new Error(err);
}
}
@ApiBearerAuth()
@UseGuards(JwtAuthGuard)
@Delete(':groupId')
async deleteGroup(@Param('groupId') groupId: number) {
try {
return await this.groupService.deleteGroup(groupId);
} catch (err) {
throw new Error(err);
}
}
}