-
Notifications
You must be signed in to change notification settings - Fork 75
Fix address payload #1820
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
Fix address payload #1820
Conversation
@@ -50,7 +44,6 @@ export const formatFormData = ( | |||
export const disableBtn = (values, errors, submitting) => { | |||
if ( | |||
errors.name || | |||
errors.phone || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this relevant to this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still pointing to ruby 3.2.2.
Please rebase with develop once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Small suggestions
); | ||
// eslint-disable-next-line no-nested-ternary | ||
const addressIndex = isNewForm | ||
? 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const addressIndex = isNewForm ? 0 : client.address?.id ?? 0;
"client[addresses_attributes[0][country]]", | ||
values.country?.value | ||
); | ||
if (!isNewForm && client.address && client.address.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!isNewForm && client?.address?.id) {
formData.append(`${addressPrefix}[id]`, client.address.id);
}
Fixes
https://saeloun-inc.sentry.io/issues/5250931858/?project=4504649746087936&query=is%3Aunresolved&referrer=issue-stream&stream_index=1