Skip to content

Commit 76fbf76

Browse files
authored
PWA-3208::getting error on address page Unable to proceed checkout as guest/registered user with my local instance after pulling latest changes (#4174)
1 parent 457bd2f commit 76fbf76

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

packages/peregrine/lib/talons/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/useGuestForm.spec.js.snap

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ Object {
99
"firstname": "Philip",
1010
"lastname": "Fry",
1111
"postcode": "10019",
12-
"region": Object {
13-
"region": "New York",
14-
"region_code": "NY",
15-
"region_id": 12,
16-
},
12+
"region": 12,
1713
"street": Array [
1814
"3000 57th Street",
1915
"Suite 200",
@@ -37,11 +33,7 @@ Object {
3733
"firstname": "Philip",
3834
"lastname": "Fry",
3935
"postcode": "10019",
40-
"region": Object {
41-
"region": "New York",
42-
"region_code": "NY",
43-
"region_id": 12,
44-
},
36+
"region": 12,
4537
"street": Array [
4638
"3000 57th Street",
4739
],

packages/peregrine/lib/talons/CheckoutPage/ShippingInformation/AddressForm/useGuestForm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const useGuestForm = props => {
6060

6161
const handleSubmit = useCallback(
6262
async formValues => {
63-
const { country, email, ...address } = formValues;
63+
const { country, email, region, ...address } = formValues;
6464
try {
6565
await setGuestShipping({
6666
variables: {
@@ -70,15 +70,15 @@ export const useGuestForm = props => {
7070
...address,
7171
// Cleans up the street array when values are null or undefined
7272
street: address.street.filter(e => e),
73-
country_code: country
73+
country_code: country,
74+
region: region.region_id || region.region
7475
}
7576
}
7677
});
7778
dispatchEvent();
7879
} catch {
7980
return;
8081
}
81-
8282
if (afterSubmit) {
8383
afterSubmit();
8484
}

0 commit comments

Comments
 (0)