From 7280f06fe8fcabbebf432f616ea42fdfe47060c4 Mon Sep 17 00:00:00 2001 From: Matthew Pritchard Date: Mon, 10 Jul 2023 11:58:19 +0100 Subject: [PATCH] LIMS-817: Add param to dispatch function --- api/src/Page/Shipment.php | 2 +- api/src/Shipment/ShippingService.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/src/Page/Shipment.php b/api/src/Page/Shipment.php index f2bf34043..491c573e9 100644 --- a/api/src/Page/Shipment.php +++ b/api/src/Page/Shipment.php @@ -976,7 +976,7 @@ function _dispatch_dewar_in_shipping_service($dispatch_info, $dewar) $response = $this->shipping_service->get_shipment($dispatch_info['DEWARID'], "FROM_FACILITY"); } $shipment_id = $response['shipmentId']; - $this->shipping_service->dispatch_shipment($shipment_id); + $this->shipping_service->dispatch_shipment($shipment_id, false); } catch (Exception $e) { throw new Exception("Error returned from shipping service: " . $e . "\nShipment data: " . $shipment_data); } diff --git a/api/src/Shipment/ShippingService.php b/api/src/Shipment/ShippingService.php index a32583833..d96e55a51 100644 --- a/api/src/Shipment/ShippingService.php +++ b/api/src/Shipment/ShippingService.php @@ -99,10 +99,11 @@ function update_shipment($external_id, $shipment_data, $journey_type) } - function dispatch_shipment($shipment_id) + function dispatch_shipment($shipment_id, $pickup_requested) { + $pickup_requested_str = ($pickup_requested) ? "true" : "false"; return $this->_send_request( - $this->shipping_api_url . '/shipments/' . $shipment_id . '/dispatch?pickup_requested=false', + $this->shipping_api_url . '/shipments/' . $shipment_id . '/dispatch?pickup_requested=' . $pickup_requested_str, "POST", null, 201