update: refferal hospital add for option

This commit is contained in:
wayanrivan
2026-04-02 09:45:58 +07:00
parent 3414bdabdf
commit a1bf5aed65
3 changed files with 28 additions and 2 deletions

View File

@ -68,6 +68,30 @@ export class RefferalHospitalController {
}
}
static async option(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
/*
#swagger.tags = ['RefferalHospital']
#swagger.security = [{ "bearerAuth": [] }]
*/
try {
var query = await RefferalHospitalModel.list();
const res_count = query;
const res_list = query.orderBy("refferal_hospital.created_at", "DESC");
const current_page = 1;
const total_count_data = await res_count.getCount();
const list_data = await res_list.getMany();
const count_data = CommonHelper.countObject(list_data);
return ReturnHelper.successResponselist(res, 200, Language.lang.success_view, count_data, current_page, total_count_data, list_data);
} catch (e: unknown) {
log.error(e);
const err = e as Error;
return ReturnHelper.errorResponse(res, 400, 401, Language.lang.failed_view, err.message);
}
}
static async export(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
/*
#swagger.tags = ['RefferalHospital']