Skip to content

Commit

Permalink
PWA-3208::getting error on address page Unable to proceed checkout as…
Browse files Browse the repository at this point in the history
… guest/registered user with my local instance after pulling latest changes
  • Loading branch information
glo80771 committed Oct 5, 2023
1 parent 457bd2f commit 864a6df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ Object {
"firstname": "Philip",
"lastname": "Fry",
"postcode": "10019",
"region": Object {
"region": "New York",
"region_code": "NY",
"region_id": 12,
},
"region": 12,
"street": Array [
"3000 57th Street",
"Suite 200",
Expand All @@ -37,11 +33,7 @@ Object {
"firstname": "Philip",
"lastname": "Fry",
"postcode": "10019",
"region": Object {
"region": "New York",
"region_code": "NY",
"region_id": 12,
},
"region": 12,
"street": Array [
"3000 57th Street",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const useGuestForm = props => {

const handleSubmit = useCallback(
async formValues => {
const { country, email, ...address } = formValues;
const { country, email, region, ...address } = formValues;
try {
await setGuestShipping({
variables: {
Expand All @@ -70,15 +70,15 @@ export const useGuestForm = props => {
...address,
// Cleans up the street array when values are null or undefined
street: address.street.filter(e => e),
country_code: country
country_code: country,
region: region.region_id || region.region
}
}
});
dispatchEvent();
} catch {
return;
}

if (afterSubmit) {
afterSubmit();
}
Expand Down

0 comments on commit 864a6df

Please sign in to comment.