Skip to content

Commit

Permalink
feat: 의과 약국 조회 API 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
eeseung committed Jul 7, 2024
1 parent 1c1747c commit d6ae795
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions backend/src/m-charts/m-charts.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ export class MChartsController {
return this.mChartsService.getTodayChartByPatientId(patientId);
}

@Get(':chartId/pharmacy')
@ApiOperation({
summary: '약국 조회',
})
@ApiResponse({
status: HttpStatus.NOT_FOUND,
})
getMChartPharmacy(@Param('chartId', ParseIntPipe) chartId: number) {
return this.mChartsService.getPharmacy(chartId);
}

@Patch(':chartId/status')
@ApiOperation({
summary: '약국 차트 상태 수정',
Expand Down
14 changes: 14 additions & 0 deletions backend/src/m-charts/m-charts.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,18 @@ export class MChartsService {
],
});
}

async getPharmacy(chartId: number) {
return await this.chartsRepository.findOne({
...DEFAULT_M_CHART_FIND_OPTIONS,
where: {
id: chartId,
},
relations: {
prescriptions: {
medicine: true,
},
},
});
}
}

0 comments on commit d6ae795

Please sign in to comment.