Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Checking Conflict in Note Creation #266

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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