chore: add crude of learning

This commit is contained in:
mahyargdz
2025-04-22 16:15:37 +03:30
parent 8598ffe67b
commit 85f541f479
2 changed files with 15 additions and 1 deletions
-1
View File
@@ -15,7 +15,6 @@ async function bootstrap() {
bodyLimit: 10 * 1024 * 1024, bodyLimit: 10 * 1024 * 1024,
}); });
// Add multipart content type parser
fastifyAdapter.getInstance().addContentTypeParser("multipart/form-data", (_request, _payload, done) => { fastifyAdapter.getInstance().addContentTypeParser("multipart/form-data", (_request, _payload, done) => {
done(null); done(null);
}); });
@@ -4,6 +4,7 @@ import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { CreateLearningCategoryDto } from "./DTO/create-learning-category.dto"; import { CreateLearningCategoryDto } from "./DTO/create-learning-category.dto";
import { CreateLearningDto } from "./DTO/create-learning.dto"; import { CreateLearningDto } from "./DTO/create-learning.dto";
import { UpdateLearningCategoryDto } from "./DTO/update-learning-category.dto"; import { UpdateLearningCategoryDto } from "./DTO/update-learning-category.dto";
import { UpdateLearningDto } from "./DTO/update-learning.dto";
import { LearningService } from "./providers/learning.service"; import { LearningService } from "./providers/learning.service";
import { AuthGuards } from "../../common/decorators/auth-guard.decorator"; import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
import { PermissionsDec } from "../../common/decorators/permission.decorator"; import { PermissionsDec } from "../../common/decorators/permission.decorator";
@@ -35,6 +36,20 @@ export class LearningController {
return this.learningService.findLearningVideoById(paramDto.id); return this.learningService.findLearningVideoById(paramDto.id);
} }
@ApiOperation({ summary: "delete learning video by id" })
@PermissionsDec(PermissionEnum.LEARNINGS)
@Delete(":id")
deleteLearningVideoById(@Param() paramDto: ParamDto) {
return this.learningService.deleteLearningVideoById(paramDto.id);
}
@ApiOperation({ summary: "update learning video by id" })
@PermissionsDec(PermissionEnum.LEARNINGS)
@Patch(":id")
updateLearningVideoById(@Param() paramDto: ParamDto, @Body() updateDto: UpdateLearningDto) {
return this.learningService.updateLearningVideo(paramDto.id, updateDto);
}
//----------------- category management ---------------------- //----------------- category management ----------------------
@ApiOperation({ summary: "Create learning category" }) @ApiOperation({ summary: "Create learning category" })