feat: add new route to get service single guide

This commit is contained in:
mahyargdz
2025-08-19 15:24:36 +03:30
parent 0764c2689f
commit aa487809ee
2 changed files with 16 additions and 0 deletions
@@ -260,6 +260,14 @@ export class DanakServicesController {
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 ------------------------
@ApiOperation({ summary: "Create service feedback => user route" })
@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) {
const queryRunner = this.dataSource.createQueryRunner();