From 640c73599cbfff6b98581c542c820073f0541bc7 Mon Sep 17 00:00:00 2001 From: LeeJongBeom <52884648+devleejb@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:14:43 +0900 Subject: [PATCH] Fix Checking Conflict in Note Creation (#266) * Fix checking conflict in note creation * Remove unused `console.log` --- backend/src/workspaces/workspaces.controller.ts | 1 - frontend/src/components/modals/CreateModal.tsx | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/workspaces/workspaces.controller.ts b/backend/src/workspaces/workspaces.controller.ts index 7aa9957c..a3df789d 100644 --- a/backend/src/workspaces/workspaces.controller.ts +++ b/backend/src/workspaces/workspaces.controller.ts @@ -68,7 +68,6 @@ export class WorkspacesController { @Req() req: AuthroizedRequest, @Param("workspace_slug") workspaceSlug: string ): Promise { - console.log(encodeURI(workspaceSlug)); return this.workspacesService.findOneBySlug(req.user.id, encodeURI(workspaceSlug)); } diff --git a/frontend/src/components/modals/CreateModal.tsx b/frontend/src/components/modals/CreateModal.tsx index 2942f85b..f8a1c86a 100644 --- a/frontend/src/components/modals/CreateModal.tsx +++ b/frontend/src/components/modals/CreateModal.tsx @@ -31,6 +31,8 @@ function CreateModal(props: CreateModalProps) { const { data: conflictResult } = useCheckNameConflictQuery(debouncedNickname); const errorMessage = useMemo(() => { + if (!enableConflictCheck) return null; + if (nickname.length < 2) { return "Title must be at least 2 characters"; } @@ -38,7 +40,7 @@ function CreateModal(props: CreateModalProps) { return "Already Exists"; } return null; - }, [nickname.length, conflictResult?.conflict]); + }, [enableConflictCheck, nickname.length, conflictResult?.conflict]); useDebounce( () => {