Skip to content

Add addAddressesToCheckout mutation#94

Merged
AlessioRocco merged 4 commits intomasterfrom
checkout-address-mutation
Apr 17, 2020
Merged

Add addAddressesToCheckout mutation#94
AlessioRocco merged 4 commits intomasterfrom
checkout-address-mutation

Conversation

@AlessioRocco
Copy link
Copy Markdown
Contributor

@AlessioRocco AlessioRocco commented Apr 3, 2020

The mutation in this PR accepts billing and shipping addresses as arguments and adds them to the currentOrder; other argument that can be used is shipToBillingAddress that is false by default.
If the shipToBillingAddress is true the billing address is also used for the shipping address; in case the user provides the shipping address, it will be ignored.

@AlessioRocco AlessioRocco changed the base branch from master to mark-default-address-mutation April 3, 2020 13:26
@AlessioRocco AlessioRocco self-assigned this Apr 3, 2020
@AlessioRocco AlessioRocco force-pushed the mark-default-address-mutation branch from e835c3a to 4036e59 Compare April 3, 2020 13:42
@AlessioRocco AlessioRocco force-pushed the checkout-address-mutation branch 2 times, most recently from 0cc0f73 to 7104fba Compare April 3, 2020 14:29
@AlessioRocco AlessioRocco changed the base branch from mark-default-address-mutation to master April 3, 2020 14:29
@AlessioRocco AlessioRocco force-pushed the checkout-address-mutation branch 5 times, most recently from f8b6395 to 8aa1a1f Compare April 10, 2020 09:14
It returned the error paths the wrong way:

["input", "order", "billAddress.firstname" ]

the correct way is:

["input", "order", "billAddress", "firstname" ]
@AlessioRocco AlessioRocco force-pushed the checkout-address-mutation branch 3 times, most recently from e084b71 to 4e5573d Compare April 10, 2020 13:12
@AlessioRocco AlessioRocco marked this pull request as ready for review April 10, 2020 13:12
@AlessioRocco AlessioRocco force-pushed the checkout-address-mutation branch 3 times, most recently from 6cbdfa6 to ad3ba8b Compare April 10, 2020 14:17
@AlessioRocco AlessioRocco force-pushed the checkout-address-mutation branch 2 times, most recently from 67bd6cf to 1972d61 Compare April 10, 2020 14:27
Copy link
Copy Markdown
Contributor

@ChristianRimondi ChristianRimondi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

The mutation accepts billing and shipping address as input and sets it
for the current order. In case the shipToBillingAddress argument is true,
it ignores the shipping address and instead uses the billing address.

It raises a CanCan::AccessDenied exception in case the current ability
can't update the current order.
Using command "bundle exec rake schema:idl"
@AlessioRocco AlessioRocco merged commit a6386ae into master Apr 17, 2020
@AlessioRocco AlessioRocco deleted the checkout-address-mutation branch April 17, 2020 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants