From 0750aa7b496659eb9391b016540dea994c657112 Mon Sep 17 00:00:00 2001 From: koomchang Date: Sat, 9 Nov 2024 15:23:46 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=BD=94=EC=8A=A4=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=ED=95=A0=20=EB=95=8C=20=EA=B6=8C=ED=95=9C=20=ED=99=95=EC=9D=B8?= =?UTF-8?q?=20#83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/course/course.controller.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/course/course.controller.ts b/backend/src/course/course.controller.ts index f9532984..b15d9705 100644 --- a/backend/src/course/course.controller.ts +++ b/backend/src/course/course.controller.ts @@ -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, ) { @@ -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, ) { @@ -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); } }