Skip to content

Commit

Permalink
Merge pull request #452 from ertush/hotfix
Browse files Browse the repository at this point in the history
Updated lines 118 - 127 of CommunityUnitsForms.js
  • Loading branch information
ertush authored Aug 14, 2024
2 parents 8648022 + 96bc7dd commit b4946ab
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions components/Forms/CommunityUnitsForms.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,17 @@ function EditCommunityUnitsBasicDeatilsForm(props) {
if (Array(touchedFields.values()).length >= 1) {
for (let field of [...touchedFields.values()]) {
if (props[field] !== formDataObject[field]) {
if (/contact_type_\d/.test(field)) {
contact = {...contact, contact_type: formDataObject[field]}
// if (/contact_type_\d/.test(field)) {
// contact = {...contact, contact_type: formDataObject[field]}

} else if (/contact_\d/.test(field)) {
contact = {...contact, contact: formDataObject[field]}
contacts.push(
contact
)
payload['contacts'] = contacts
} else if (/chcs_.+/.test(field) || /chas_.+/.test(field) || /chps_.+/.test(field)){
// } else if (/contact_\d/.test(field)) {
// contact = {...contact, contact: formDataObject[field]}
// contacts.push(
// contact
// )
// payload['contacts'] = contacts
// } else
if (/chcs_.+/.test(field) || /chas_.+/.test(field) || /chps_.+/.test(field)){
payload[field] = formDataObject[field]
}
else {
Expand Down Expand Up @@ -174,7 +175,7 @@ function EditCommunityUnitsBasicDeatilsForm(props) {

const error = Array.isArray(Object.values(detail)) && Object.values(detail).length == 1 ? detail[Object.keys(detail)[0]][0] : ''

setFormError(error)
setFormError(error)

alert.error('Unable to save Community Units Basic details')
}
Expand Down

0 comments on commit b4946ab

Please sign in to comment.