This commit is contained in:
Muhammad Rayhan Ardiansyah
2026-04-06 10:22:24 +07:00
5 changed files with 131 additions and 39 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']

View File

@ -100,7 +100,7 @@ export class RegistrationFeeController {
/*
#swagger.tags = ['Registration Fee']
#swagger.security = [{ "bearerAuth": [] }]
#swagger.parameters['id'] = { description: 'Room ID', in: 'path', type: 'string' }
#swagger.parameters['id'] = { description: 'ID', in: 'path', type: 'string' }
#swagger.requestBody = { required: true, content: { "application/json": { schema: { $ref: "#/components/schemas/registration_fee" } } } }
*/
const queryRunner = OrmHelper.DB.createQueryRunner();