fix: allow renaming custom field (#803)

* fix: allow renaming custom field

* style: change time-to-end icon
This commit is contained in:
Carlos Valente
2024-03-07 19:59:36 +01:00
committed by GitHub
parent d22cc48565
commit d59885fc20
2 changed files with 5 additions and 4 deletions
@@ -404,12 +404,13 @@ export const editCustomField = async (label: string, newField: Partial<CustomFie
throw new Error('Change of field type is not allowed');
}
persistedCustomFields[newField.label] = { ...existingField, ...newField };
if (existingField.label !== newField.label) {
delete persistedCustomFields[existingField.label];
customFieldChangelog[label] = newField.label;
}
persistedCustomFields[label] = { ...existingField, ...newField };
scheduleCustomFieldPersist(persistedCustomFields);
invalidateIfUsed(label);