Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PWA-3208::getting error on address page Unable to proceed checkout as… #4174

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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