Skip to content

Commit 640c735

Browse files
authored
Fix Checking Conflict in Note Creation (#266)
* Fix checking conflict in note creation * Remove unused `console.log`
1 parent f6d4997 commit 640c735

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

backend/src/workspaces/workspaces.controller.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export class WorkspacesController {
6868
@Req() req: AuthroizedRequest,
6969
@Param("workspace_slug") workspaceSlug: string
7070
): Promise<FindWorkspaceResponse> {
71-
console.log(encodeURI(workspaceSlug));
7271
return this.workspacesService.findOneBySlug(req.user.id, encodeURI(workspaceSlug));
7372
}
7473

frontend/src/components/modals/CreateModal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,16 @@ function CreateModal(props: CreateModalProps) {
3131
const { data: conflictResult } = useCheckNameConflictQuery(debouncedNickname);
3232

3333
const errorMessage = useMemo(() => {
34+
if (!enableConflictCheck) return null;
35+
3436
if (nickname.length < 2) {
3537
return "Title must be at least 2 characters";
3638
}
3739
if (conflictResult?.conflict) {
3840
return "Already Exists";
3941
}
4042
return null;
41-
}, [nickname.length, conflictResult?.conflict]);
43+
}, [enableConflictCheck, nickname.length, conflictResult?.conflict]);
4244

4345
useDebounce(
4446
() => {

0 commit comments

Comments
 (0)