Fix name checks
This commit is contained in:
parent
732d701a86
commit
46a7f15fed
|
@ -19,12 +19,13 @@ async function ensureUniqueAndThrow(
|
|||
existingRowActionId?: string
|
||||
) {
|
||||
const names = await getNames(doc)
|
||||
name = name.toLowerCase()
|
||||
name = name.toLowerCase().trim()
|
||||
|
||||
if (
|
||||
Object.entries(names).find(
|
||||
([automationId, automationName]) =>
|
||||
automationName === name && automationId !== existingRowActionId
|
||||
automationName.toLowerCase().trim() === name &&
|
||||
automationId !== existingRowActionId
|
||||
)
|
||||
) {
|
||||
throw new HTTPError("A row action with the same name already exists.", 409)
|
||||
|
|
Loading…
Reference in New Issue