chore: add service review add and get in service page and also approve and reject for admin

This commit is contained in:
mahyargdz
2025-02-17 15:08:22 +03:30
parent 763b6b49d9
commit b7cfaf95b2
12 changed files with 186 additions and 47 deletions
@@ -1,6 +1,7 @@
import { Body, Controller, Get, HttpCode, HttpStatus, Param, Post, Query } from "@nestjs/common";
import { ApiOperation, ApiTags } from "@nestjs/swagger";
import { AddReviewDto } from "./DTO/add-review.dto";
import { CategoryListSearchQueryDto, CategorySearchQueryDto } from "./DTO/category-search-query.dto";
import { CreateCategoryDto } from "./DTO/create-category.dto";
import { CreateServiceDto } from "./DTO/create-service.dto";
@@ -106,6 +107,13 @@ export class DanakServicesController {
return this.danakServicesService.getDanakServiceByIdWithSubs(paramDto.id, isAdmin);
}
@ApiOperation({ summary: "add review to danak service ==> user route" })
@AuthGuards()
@Post(":id/reviews")
addReview(@Param() paramDto: ParamDto, @Body() addReviewDto: AddReviewDto, @UserDec("id") userId: string) {
return this.danakServicesService.addReview(userId, paramDto.id, addReviewDto);
}
// @AuthGuards()
//
// @ApiOperation({ summary: "get all user purchased danak services" })