chore(core-flows): order edit - remove item update action (#8722)

This commit is contained in:
Carlos R. L. Rodrigues
2024-08-22 08:32:27 -03:00
committed by GitHub
parent cad6dae231
commit 4c43122358
2 changed files with 8 additions and 3 deletions
@@ -47,8 +47,14 @@ export const removeOrderEditItemActionValidationStep = createStep(
throw new Error(
`No item found for order ${input.order_id} in order change ${orderChange.id}`
)
} else if (associatedAction.action !== ChangeActionType.ITEM_ADD) {
throw new Error(`Action ${associatedAction.id} is not adding an item`)
} else if (
![ChangeActionType.ITEM_ADD, ChangeActionType.ITEM_UPDATE].includes(
associatedAction.action as ChangeActionType
)
) {
throw new Error(
`Action ${associatedAction.id} is not adding or updating an item`
)
}
}
)
-1
View File
@@ -9,7 +9,6 @@ import { ClaimReason } from "./mutations"
* The change action's type.
*/
export type ChangeActionType =
| "CANCEL"
| "CANCEL_RETURN_ITEM"
| "FULFILL_ITEM"
| "CANCEL_ITEM_FULFILLMENT"