feat: add payment module
This commit is contained in:
12
modules/payment/routes/beneficiaries/:id/handle.ts
Normal file
12
modules/payment/routes/beneficiaries/:id/handle.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { NotFoundError } from "@platform/relay";
|
||||
|
||||
import { getBeneficiaryById } from "../../../repositories/beneficiary.ts";
|
||||
import route from "./spec.ts";
|
||||
|
||||
export default route.access("public").handle(async ({ params: { id } }) => {
|
||||
const beneficiary = await getBeneficiaryById(id);
|
||||
if (beneficiary === undefined) {
|
||||
return new NotFoundError();
|
||||
}
|
||||
return beneficiary;
|
||||
});
|
||||
Reference in New Issue
Block a user