From a60631e4e8b8b6eb2cf4f04a419bf5517e0bf1da Mon Sep 17 00:00:00 2001 From: Paulo Endoh Date: Thu, 26 Oct 2023 13:18:38 -0300 Subject: [PATCH] tag modal -- when changing to public, it says: 'Name must be unique' [clni50cu0000lyr0kqarg4f6l] --- src/domains/relearn/tag/TagService.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/domains/relearn/tag/TagService.ts b/src/domains/relearn/tag/TagService.ts index 5c0cdea..a4ecec8 100644 --- a/src/domains/relearn/tag/TagService.ts +++ b/src/domains/relearn/tag/TagService.ts @@ -1,4 +1,5 @@ import { BadRequestError } from "routing-controllers" +import { Not } from "typeorm" import { Tag } from "../../../entities/relearn/Tag" import TagRepository from "../../../repositories/relearn/TagRepository" @@ -24,6 +25,7 @@ export class TagService { where: { name: data.name, userId: userId, + id: Not(data.id), }, }) if (nameExists) {