fix: prevent unnecessary config operations when renaming to same name

- Add validation in UI to early return when renaming config to current name
- Add server-side validation to prevent config save/delete operations
This commit is contained in:
sam hoang
2025-02-01 10:49:09 +07:00
parent 8ce5f9a890
commit ab556286f1
2 changed files with 9 additions and 0 deletions

View File

@@ -60,6 +60,11 @@ const ApiConfigManager = ({
if (editState === "new") {
onUpsertConfig(trimmedValue)
} else if (editState === "rename" && currentApiConfigName) {
if (currentApiConfigName === trimmedValue) {
setEditState(null)
setInputValue("")
return
}
onRenameConfig(currentApiConfigName, trimmedValue)
}