Skip to content

Commit

Permalink
chore: Update API
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Oct 17, 2023
1 parent c4bb206 commit 37a6da3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api.planx.uk/inviteToPay/createPaymentSendEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const createPaymentSendEvents = async (
const now = new Date();
const combinedResponse: CombinedResponse = {};

const session = await $api.getSessionById(payload.sessionId);
const session = await $api.session.find(payload.sessionId);
if (!session) {
return next({
status: 400,
Expand Down
6 changes: 3 additions & 3 deletions api.planx.uk/inviteToPay/inviteToPay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function inviteToPay(
}

// lock session before creating a payment request
const locked = await $api.lockSession(sessionId);
const locked = await $api.session.lock(sessionId);
if (locked === null) {
return next(
new ServerError({
Expand All @@ -63,7 +63,7 @@ export async function inviteToPay(

let paymentRequest: PaymentRequest | undefined;
try {
paymentRequest = await $api.createPaymentRequest({
paymentRequest = await $api.paymentRequest.create({
sessionId,
applicantName,
payeeName,
Expand All @@ -72,7 +72,7 @@ export async function inviteToPay(
});
} catch (e: unknown) {
// revert the session lock on failure
await $api.unlockSession(sessionId);
await $api.session.unlock(sessionId);
return next(
new ServerError({
message:
Expand Down
2 changes: 1 addition & 1 deletion api.planx.uk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"dependencies": {
"@airbrake/node": "^2.1.8",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#3a85966",
"@opensystemslab/planx-core": "git+https://github.com/theopensystemslab/planx-core#280aaff",
"@types/isomorphic-fetch": "^0.0.36",
"adm-zip": "^0.5.10",
"aws-sdk": "^2.1467.0",
Expand Down
9 changes: 5 additions & 4 deletions api.planx.uk/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37a6da3

Please sign in to comment.