From 1381ed032d5d211211dcfd88fc30c332f37cf81f Mon Sep 17 00:00:00 2001 From: Saksham Arora Date: Mon, 3 Jun 2024 16:05:36 +0200 Subject: [PATCH] api: loans: Update request parameters --- src/lib/api/loans/loan.js | 5 ++- .../frontsite/SelfCheckout/SelfCheckout.js | 36 ++++++++++--------- .../frontsite/SelfCheckout/state/actions.js | 4 +-- 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/lib/api/loans/loan.js b/src/lib/api/loans/loan.js index ef7cd24d2..865ac5337 100644 --- a/src/lib/api/loans/loan.js +++ b/src/lib/api/loans/loan.js @@ -88,7 +88,7 @@ const doCheckout = async ( documentPid, itemPid, patronPid, - { startDate = null, endDate = null, force = false } = {} + { startDate = null, endDate = null, force = false, selfCheckout = false } = {} ) => { const currentUser = sessionManager.user; const payload = { @@ -108,6 +108,9 @@ const doCheckout = async ( if (force) { payload.force = true; } + if (selfCheckout) { + payload.self_checkout = true; + } const response = await http.post(apiPaths.checkout, payload); response.data = serializer.fromJSON(response.data); diff --git a/src/lib/pages/frontsite/SelfCheckout/SelfCheckout.js b/src/lib/pages/frontsite/SelfCheckout/SelfCheckout.js index 8d7f3bfdc..8606a9b91 100644 --- a/src/lib/pages/frontsite/SelfCheckout/SelfCheckout.js +++ b/src/lib/pages/frontsite/SelfCheckout/SelfCheckout.js @@ -105,22 +105,26 @@ class SelfCheckout extends React.Component { - - - - - - + + + + + + + + ); diff --git a/src/lib/pages/frontsite/SelfCheckout/state/actions.js b/src/lib/pages/frontsite/SelfCheckout/state/actions.js index e840a043c..214a1e0f8 100644 --- a/src/lib/pages/frontsite/SelfCheckout/state/actions.js +++ b/src/lib/pages/frontsite/SelfCheckout/state/actions.js @@ -52,7 +52,7 @@ export const checkoutItem = ( documentPid, itemPid, patronPid, - force = false + selfCheckout = true ) => { return async (dispatch) => { try { @@ -60,7 +60,7 @@ export const checkoutItem = ( documentPid, itemPid, patronPid, - { force: force } + { selfCheckout: selfCheckout } ); const { pid } = response.data.metadata; const linkToLoan = (