diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 7432c43a96..a2c38fa75a 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -816,6 +816,7 @@ class App { TagHelpers.validateRequestBody(req.body); const { name } = req.body; + await TagHelpers.validateName(name); TagHelpers.validateLength(name); const id = Number(req.params.id); diff --git a/packages/cli/src/TagHelpers.ts b/packages/cli/src/TagHelpers.ts index 5390ccb787..d80dddc461 100644 --- a/packages/cli/src/TagHelpers.ts +++ b/packages/cli/src/TagHelpers.ts @@ -2,7 +2,7 @@ import { FindOneOptions, getConnection } from "typeorm"; import { Db, ResponseHelper } from "."; /** - * Validate whether a tag name exists so that it cannot be used for a create operation. + * Validate whether a tag name exists so that it cannot be used for a create/update operation. */ export async function validateName(name: string): Promise | never { const findQuery = { where: { name } } as FindOneOptions;