Skip to content

Commit

Permalink
fix: Types in API
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Mar 20, 2024
1 parent 5a8ea77 commit 57ac621
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.planx.uk/modules/pay/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ interface GovPayCreatePayment {

export async function buildPaymentPayload(
req: Request,
res: Response<object, { govPayMetadata: GovPayMetadata[] }>,
res: Response,
next: NextFunction,
) {
if (!req.query.returnURL) {
Expand All @@ -129,7 +129,7 @@ export async function buildPaymentPayload(
}

// Convert metadata to format required by GovPay
const govPayMetadata = Object.fromEntries(res.locals.govPayMetadata.map(({ key, value }) => [key, value]));
const govPayMetadata = Object.fromEntries(res.locals.govPayMetadata.map(({ key, value }: GovPayMetadata) => [key, value]));

const createPaymentBody: GovPayCreatePayment = {
amount: parseInt(req.params.paymentAmount),
Expand Down

0 comments on commit 57ac621

Please sign in to comment.