diff --git a/backend/src/check/check.service.ts b/backend/src/check/check.service.ts index 8306887d..8fe80751 100644 --- a/backend/src/check/check.service.ts +++ b/backend/src/check/check.service.ts @@ -15,7 +15,7 @@ export class CheckService { ) {} async checkNameConflict(name: string): Promise { - const encodedText = encodeURIComponent(name); + const encodedText = encodeURI(name); const conflictUserList = await this.prismaService.user.findMany({ where: { OR: [{ nickname: name }, { nickname: encodedText }], diff --git a/backend/src/users/users.service.ts b/backend/src/users/users.service.ts index c7d58a21..c44a7369 100644 --- a/backend/src/users/users.service.ts +++ b/backend/src/users/users.service.ts @@ -94,7 +94,7 @@ export class UsersService { }, }); - const encodedText = encodeURIComponent(nickname); + const encodedText = encodeURI(nickname); if (!userWorkspaceList.length) { const { id: workspaceId } = await this.prismaService.workspace.create({ diff --git a/backend/src/workspaces/workspaces.controller.ts b/backend/src/workspaces/workspaces.controller.ts index a1e6371d..7aa9957c 100644 --- a/backend/src/workspaces/workspaces.controller.ts +++ b/backend/src/workspaces/workspaces.controller.ts @@ -68,7 +68,8 @@ export class WorkspacesController { @Req() req: AuthroizedRequest, @Param("workspace_slug") workspaceSlug: string ): Promise { - return this.workspacesService.findOneBySlug(req.user.id, encodeURIComponent(workspaceSlug)); + console.log(encodeURI(workspaceSlug)); + return this.workspacesService.findOneBySlug(req.user.id, encodeURI(workspaceSlug)); } @Get("") diff --git a/backend/src/workspaces/workspaces.service.ts b/backend/src/workspaces/workspaces.service.ts index aca25e8f..df4c9035 100644 --- a/backend/src/workspaces/workspaces.service.ts +++ b/backend/src/workspaces/workspaces.service.ts @@ -30,7 +30,7 @@ export class WorkspacesService { const workspace = await this.prismaService.workspace.create({ data: { title, - slug: encodeURIComponent(title), + slug: encodeURI(title), }, });