feat: add new route to get service single guide
This commit is contained in:
@@ -260,6 +260,14 @@ export class DanakServicesController {
|
|||||||
return this.danakServicesService.deleteServiceGuide(paramDto.id);
|
return this.danakServicesService.deleteServiceGuide(paramDto.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation({ summary: "Get service guide by id => admin route" })
|
||||||
|
@AuthGuards()
|
||||||
|
@PermissionsDec(PermissionEnum.SERVICES)
|
||||||
|
@Get("guides/:id")
|
||||||
|
getServiceGuideById(@Param() paramDto: ParamDto) {
|
||||||
|
return this.danakServicesService.getServiceGuideById(paramDto.id);
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------ service feedback ------------------------
|
//------------------------ service feedback ------------------------
|
||||||
@ApiOperation({ summary: "Create service feedback => user route" })
|
@ApiOperation({ summary: "Create service feedback => user route" })
|
||||||
@AuthGuards()
|
@AuthGuards()
|
||||||
|
|||||||
@@ -679,6 +679,14 @@ export class DanakServicesService {
|
|||||||
|
|
||||||
/******************************************** */
|
/******************************************** */
|
||||||
|
|
||||||
|
async getServiceGuideById(guideId: string) {
|
||||||
|
const guide = await this.danakServiceGuideRepository.findOneBy({ id: guideId, deletedAt: IsNull() });
|
||||||
|
if (!guide) throw new BadRequestException(ServiceMessage.SERVICE_GUIDE_NOT_EXIST);
|
||||||
|
return { guide };
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************** */
|
||||||
|
|
||||||
async createServiceFeedback(createDto: CreateServiceFeedbackDto, headers: Record<string, string>, ip: string) {
|
async createServiceFeedback(createDto: CreateServiceFeedbackDto, headers: Record<string, string>, ip: string) {
|
||||||
const queryRunner = this.dataSource.createQueryRunner();
|
const queryRunner = this.dataSource.createQueryRunner();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user