update: add review count and also verification from admin panel
This commit is contained in:
@@ -5,6 +5,7 @@ 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";
|
||||
import { DanakServiceReviewQueryDto } from "./DTO/danak-service-review-query.dto";
|
||||
import { DanakServicesSearchQueryDto } from "./DTO/danak-services-search-query.dto";
|
||||
import { DanakServicesService } from "./providers/danak-services.service";
|
||||
import { AuthGuards } from "../../common/decorators/auth-guard.decorator";
|
||||
@@ -103,8 +104,8 @@ export class DanakServicesController {
|
||||
@ApiOperation({ summary: "get danak service by id" })
|
||||
@AuthGuards()
|
||||
@Get(":id")
|
||||
getDanakServiceById(@Param() paramDto: ParamDto, @UserDec("isAdmin") isAdmin: boolean) {
|
||||
return this.danakServicesService.getDanakServiceByIdWithSubs(paramDto.id, isAdmin);
|
||||
getDanakServiceById(@Param() paramDto: ParamDto, @UserDec("isAdmin") isAdmin: boolean, @UserDec("id") userId: string) {
|
||||
return this.danakServicesService.getDanakServiceByIdWithSubs(paramDto.id, isAdmin, userId);
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: "add review to danak service ==> user route" })
|
||||
@@ -114,6 +115,15 @@ export class DanakServicesController {
|
||||
return this.danakServicesService.addReview(userId, paramDto.id, addReviewDto);
|
||||
}
|
||||
|
||||
@ApiOperation({ summary: "get danak service reviews ==> admin route" })
|
||||
@AuthGuards()
|
||||
@Pagination()
|
||||
@PermissionsDec(PermissionEnum.SERVICES)
|
||||
@Get("reviews")
|
||||
getDanakServiceReviews(@Query() queryDto: DanakServiceReviewQueryDto) {
|
||||
return this.danakServicesService.getDanakServiceReviews(queryDto);
|
||||
}
|
||||
|
||||
// @AuthGuards()
|
||||
//
|
||||
// @ApiOperation({ summary: "get all user purchased danak services" })
|
||||
|
||||
Reference in New Issue
Block a user