update: refferal hospital add for option
This commit is contained in:
@ -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']
|
||||
|
||||
Reference in New Issue
Block a user