Skip to content

Commit

Permalink
Change encodeURIComponent to encodeURI
Browse files Browse the repository at this point in the history
  • Loading branch information
devleejb committed Aug 2, 2024
1 parent 16e8d91 commit 5f5b7e6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/check/check.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class CheckService {
) {}

async checkNameConflict(name: string): Promise<CheckNameConflicReponse> {
const encodedText = encodeURIComponent(name);
const encodedText = encodeURI(name);
const conflictUserList = await this.prismaService.user.findMany({
where: {
OR: [{ nickname: name }, { nickname: encodedText }],
Expand Down
2 changes: 1 addition & 1 deletion backend/src/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
3 changes: 2 additions & 1 deletion backend/src/workspaces/workspaces.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export class WorkspacesController {
@Req() req: AuthroizedRequest,
@Param("workspace_slug") workspaceSlug: string
): Promise<FindWorkspaceResponse> {
return this.workspacesService.findOneBySlug(req.user.id, encodeURIComponent(workspaceSlug));
console.log(encodeURI(workspaceSlug));
return this.workspacesService.findOneBySlug(req.user.id, encodeURI(workspaceSlug));
}

@Get("")
Expand Down
2 changes: 1 addition & 1 deletion backend/src/workspaces/workspaces.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class WorkspacesService {
const workspace = await this.prismaService.workspace.create({
data: {
title,
slug: encodeURIComponent(title),
slug: encodeURI(title),
},
});

Expand Down

0 comments on commit 5f5b7e6

Please sign in to comment.