hotfix(medusa-fulfillment-webshipper): Cancel fulfillment idempotently (#175)

This commit is contained in:
Oliver Windall Juhl
2021-02-18 13:46:34 +01:00
committed by GitHub
parent f32ae72782
commit 90ea888829

View File

@@ -523,6 +523,11 @@ class WebshipperFulfillmentService extends FulfillmentService {
.retrieve(data.id)
.catch(() => undefined)
// if order does not exist, we resolve gracefully
if (!order) {
return Promise.resolve()
}
if (order) {
if (order.data.attributes.status !== "pending") {
if (order.data.attributes.status === "cancelled") {