fix: Duplicated items id

pull/2672/head
Anderson Shindy Oki 7 months ago
parent 97f3f401b5
commit 6e7e20175f

@ -148,9 +148,19 @@ const Table: FunctionComponent = () => {
icon={faWrench}
c="gray"
onClick={() => {
// We once had an issue on the past where there were duplicated
// item ids that needs to become unique upon editing.
const sanitizedProfile = {
...cloneDeep(profile),
items: profile.items.map((value, index) => {
return { ...value, id: index + 1 };
}),
tag: profile.tag || undefined,
};
modals.openContextModal(ProfileEditModal, {
languages,
profile: cloneDeep(profile),
profile: sanitizedProfile,
onComplete: updateProfile,
});
}}

Loading…
Cancel
Save