Skip to content

Commit

Permalink
Fix Checking Conflict in Note Creation (#266)
Browse files Browse the repository at this point in the history
* Fix checking conflict in note creation

* Remove unused `console.log`
  • Loading branch information
devleejb authored Aug 3, 2024
1 parent f6d4997 commit 640c735
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion backend/src/workspaces/workspaces.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export class WorkspacesController {
@Req() req: AuthroizedRequest,
@Param("workspace_slug") workspaceSlug: string
): Promise<FindWorkspaceResponse> {
console.log(encodeURI(workspaceSlug));
return this.workspacesService.findOneBySlug(req.user.id, encodeURI(workspaceSlug));
}

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/components/modals/CreateModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ 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";
}
if (conflictResult?.conflict) {
return "Already Exists";
}
return null;
}, [nickname.length, conflictResult?.conflict]);
}, [enableConflictCheck, nickname.length, conflictResult?.conflict]);

useDebounce(
() => {
Expand Down

0 comments on commit 640c735

Please sign in to comment.