Skip to content

Commit

Permalink
store all items when updating one
Browse files Browse the repository at this point in the history
  • Loading branch information
boyum committed Jan 7, 2022
1 parent 0f4957f commit 2d1d543
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/TopicMapItemForm/TopicMapItemForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const TopicMapItemForm: React.FC<TopicMapItemFormProps> = ({
const updatedItem = newParams.topicMapItems[0];
onSave({
...newParams,
topicMapItems: newParams.topicMapItems.map(item => {
const isUpdatedItem = item.id === itemId;
topicMapItems: params.topicMapItems.map(item => {
const isUpdatedItem = item.id === updatedItem.id;
if (isUpdatedItem) {
return updatedItem;
}
Expand Down

0 comments on commit 2d1d543

Please sign in to comment.