Created
February 17, 2020 14:03
-
-
Save dturton/2f9cafe2770060ee6eba0a378ba0f037 to your computer and use it in GitHub Desktop.
CreateOrderFulfillment.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ORDER_SATUS_ARRAY = ["SHIPPED", "IN_TRANSIT"]; | |
| export const handle = function*(sosOrder) { | |
| this.sosOrder = sosOrder; | |
| try { | |
| this.w2gOrder = yield this.run.task("GetOrderStatus", this.sosOrder); | |
| if (ORDER_SATUS_ARRAY.includes(this.w2gOrder.status)) { | |
| yield this.run.task("ShipOrder", this.sosOrder, this.w2gOrder); | |
| } | |
| } catch (error) { | |
| console.error(error.response.data); | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment