Feat/fulfill swaps and claims with locations (#3518)

* re-add if statements

* initial implementation

* add changeset

* address feedback

* remove context param from create-fulfillment

* fix tests
This commit is contained in:
Philip Korsholm
2023-03-20 13:48:25 +01:00
committed by GitHub
parent ea2633bccf
commit 026bdab05d
13 changed files with 149 additions and 33 deletions

View File

@@ -172,10 +172,6 @@ const CreateFulfillmentModal: React.FC<CreateFulfillmentModalProps> = ({
no_notification: noNotis,
} as AdminPostOrdersOrderFulfillmentsReq
if (isLocationFulfillmentEnabled) {
requestObj.location_id = locationSelectValue.value
}
requestObj.items = Object.entries(quantities)
.filter(([, value]) => !!value)
.map(([key, value]) => ({
@@ -185,6 +181,10 @@ const CreateFulfillmentModal: React.FC<CreateFulfillmentModalProps> = ({
break
}
if (isLocationFulfillmentEnabled) {
requestObj.location_id = locationSelectValue.value
}
action.mutate(requestObj, {
onSuccess: () => {
notification("Success", successText, "success")