Skip to content

Commit

Permalink
Merge pull request #1149 from akvo/bug/1147-null-administration-endpo…
Browse files Browse the repository at this point in the history
…int-is-always-triggering

[#1147] null administration endpoiont trigering changed value to id
  • Loading branch information
ifirmawan authored Feb 8, 2024
2 parents 710fbe5 + 20443b5 commit e4de57d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions frontend/src/components/EditableCell.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ const EditableCell = ({
if (typeof record.value === "string") {
setLocationName(record.value);
} else {
config.fn.administration(record.value, false).then((res) => {
const locName = res;
setLocationName(locName?.full_name);
});
if (record.value) {
config.fn.administration(record.value, false).then((res) => {
const locName = res;
setLocationName(locName?.full_name);
});
} else {
setLocationName(null);
}
}
}
}, [record, locationName]);
Expand Down

0 comments on commit e4de57d

Please sign in to comment.