Skip to content

Commit

Permalink
feat: 코스 삭제할 때 권한 확인 #83
Browse files Browse the repository at this point in the history
  • Loading branch information
koomchang committed Nov 13, 2024
1 parent d1e9908 commit 0750aa7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/src/course/course.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ export class CourseController {
}

@Patch('/:id/info')
@UseGuards(JwtAuthGuard, CoursePermissionGuard)
async updateCourseInfo(
@AuthUser() user: AuthUser,
@Param('id') id: number,
@Body() updateCourseInfoRequest: UpdateCourseInfoRequest,
) {
Expand All @@ -79,7 +81,9 @@ export class CourseController {
}

@Patch('/:id/visibility')
@UseGuards(JwtAuthGuard, CoursePermissionGuard)
async updateCourseVisibility(
@AuthUser() user: AuthUser,
@Param('id') id: number,
@Body('isPublic') isPublic: boolean,
) {
Expand All @@ -88,7 +92,8 @@ export class CourseController {
}

@Delete('/:id')
async deleteCourse(@Param('id') id: number) {
@UseGuards(JwtAuthGuard, CoursePermissionGuard)
async deleteCourse(@AuthUser() user: AuthUser, @Param('id') id: number) {
return await this.courseService.deleteCourse(id);
}
}

0 comments on commit 0750aa7

Please sign in to comment.