fixing
This commit is contained in:
@ -336,4 +336,28 @@ export class PatientGroupController {
|
||||
return ReturnHelper.errorResponse(res, 500, 402, Language.lang.failed_restore, err.message);
|
||||
}
|
||||
}
|
||||
|
||||
static async detail(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
||||
/*
|
||||
#swagger.tags = ['PatientGroup']
|
||||
#swagger.security = [{ "bearerAuth": [] }]
|
||||
#swagger.parameters['id'] = { description: '', in: 'path', type: 'string' }
|
||||
*/
|
||||
try {
|
||||
const schema = Joi.object().keys({
|
||||
id: Joi.string().uuid().required().label("Patient Group Id"),
|
||||
});
|
||||
|
||||
let param: any = await schema.validateAsync(req.params);
|
||||
|
||||
let data = await PatientGroupModel.list({ "id": param.id }).then((q) => q.getOne());
|
||||
if (!data) throw { message: "Patient Group Not Found" };
|
||||
|
||||
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_view, data);
|
||||
} catch (e: unknown) {
|
||||
log.error(e);
|
||||
const err = e as Error;
|
||||
return ReturnHelper.errorResponse(res, 400, 401, Language.lang.failed_not_found, err.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -371,4 +371,28 @@ export class PatientGuarantorController {
|
||||
return ReturnHelper.errorResponse(res, 500, 402, Language.lang.failed_restore, err.message);
|
||||
}
|
||||
}
|
||||
|
||||
static async detail(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
|
||||
/*
|
||||
#swagger.tags = ['PatientGuarantor']
|
||||
#swagger.security = [{ "bearerAuth": [] }]
|
||||
#swagger.parameters['id'] = { description: '', in: 'path', type: 'string' }
|
||||
*/
|
||||
try {
|
||||
const schema = Joi.object().keys({
|
||||
id: Joi.string().uuid().required().label("Patient Guarantor Id"),
|
||||
});
|
||||
|
||||
let param: any = await schema.validateAsync(req.params);
|
||||
|
||||
let data = await PatientGuarantorModel.list({ "id": param.id }).then((q) => q.getOne());
|
||||
if (!data) throw { message: "Patient Guarantor Not Found" };
|
||||
|
||||
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_view, data);
|
||||
} catch (e: unknown) {
|
||||
log.error(e);
|
||||
const err = e as Error;
|
||||
return ReturnHelper.errorResponse(res, 400, 401, Language.lang.failed_not_found, err.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -403,6 +403,7 @@ export class RoutePrivate {
|
||||
app.put('/api/patient-group/update/:id', PatientGroupController.update)
|
||||
app.delete('/api/patient-group/delete/:id/:hard', PatientGroupController.delete)
|
||||
app.put('/api/patient-group/restore/:id', PatientGroupController.restore)
|
||||
app.get('/api/patient-group/view/:id', PatientGuarantorController.detail)
|
||||
|
||||
app.get('/api/patient-guarantor/list', PatientGuarantorController.list)
|
||||
app.get('/api/patient-guarantor/export', PatientGuarantorController.export)
|
||||
@ -410,6 +411,7 @@ export class RoutePrivate {
|
||||
app.put('/api/patient-guarantor/update/:id', PatientGuarantorController.update)
|
||||
app.delete('/api/patient-guarantor/delete/:id/:hard', PatientGuarantorController.delete)
|
||||
app.put('/api/patient-guarantor/restore/:id', PatientGuarantorController.restore)
|
||||
app.get('/api/patient-guarantor/view/:id', PatientGuarantorController.detail)
|
||||
|
||||
app.get('/api/refferal-hospital/list', RefferalHospitalController.list)
|
||||
app.get('/api/refferal-hospital/export', RefferalHospitalController.export)
|
||||
|
||||
Reference in New Issue
Block a user