update : detail for registration fee

This commit is contained in:
wayanrivan
2026-03-30 11:36:23 +07:00
parent f7fdfb7590
commit 05327a17fb
2 changed files with 22 additions and 1 deletions

View File

@ -20,6 +20,26 @@ const RegistrationFeeCreateAndUpdateSchema = {
}; };
export class RegistrationFeeController { export class RegistrationFeeController {
static async detail(req: Request, res: Response, next: NextFunction): Promise<void | Response> {
/*
#swagger.tags = ['Registration Fee']
#swagger.security = [{ "bearerAuth": [] }]
*/
try {
const result = await OrmHelper.DB.getRepository(RegistrationFee)
.createQueryBuilder("RegistrationFee")
.getMany();
if (!result || result.length === 0) throw { message: "Registration Fee " + Language.lang.failed_not_found };
return ReturnHelper.successResponseAny(res, 200, Language.lang.success_view, result);
} catch (e: unknown) {
log.error(e);
const err = e as Error;
return ReturnHelper.errorResponse(res, 400, 401, Language.lang.failed_not_found, err.message);
}
}
static async create(req: Request, res: Response, next: NextFunction): Promise<Response> { static async create(req: Request, res: Response, next: NextFunction): Promise<Response> {
/* /*
#swagger.tags = ['Registration Fee'] #swagger.tags = ['Registration Fee']

View File

@ -478,6 +478,7 @@ export class RoutePrivate {
app.delete('/api/payment-method/delete/:id/:hard', PaymentMethodController.delete) app.delete('/api/payment-method/delete/:id/:hard', PaymentMethodController.delete)
app.put('/api/payment-method/restore/:id', PaymentMethodController.restore) app.put('/api/payment-method/restore/:id', PaymentMethodController.restore)
app.get('/api/registration-fee/detail', RegistrationFeeController.detail)
app.post('/api/registration-fee/create', RegistrationFeeController.create) app.post('/api/registration-fee/create', RegistrationFeeController.create)
app.put('/api/registration-fee/update/:id', RegistrationFeeController.update) app.put('/api/registration-fee/update/:id', RegistrationFeeController.update)
} }