diff --git a/epictrack-web/src/services/indigenousNationService/indigenousNationService.ts b/epictrack-web/src/services/indigenousNationService/indigenousNationService.ts index 1b2467648..1fb4178bb 100644 --- a/epictrack-web/src/services/indigenousNationService/indigenousNationService.ts +++ b/epictrack-web/src/services/indigenousNationService/indigenousNationService.ts @@ -37,9 +37,10 @@ class IndigenousNationService implements ServiceBase { ); } async checkIndigenousNationExists(name: string, id: number) { + const encodedName = encodeURIComponent(name); return await http.GetRequest( Endpoints.IndigenousNations.INDIGENOUS_NATIONS + - `/exists?name=${name}${id ? "&indigenous_nation_id=" + id : ""}` + `/exists?name=${encodedName}${id ? "&indigenous_nation_id=" + id : ""}` ); } } diff --git a/epictrack-web/src/services/projectService/projectService.ts b/epictrack-web/src/services/projectService/projectService.ts index 32c9560b8..dc6e78974 100644 --- a/epictrack-web/src/services/projectService/projectService.ts +++ b/epictrack-web/src/services/projectService/projectService.ts @@ -37,9 +37,10 @@ class ProjectService implements ServiceBase { } async checkProjectExists(name: string, id: number) { + const encodedName = encodeURIComponent(name); return await http.GetRequest( Endpoints.Projects.PROJECTS + - `/exists?name=${name}${id ? "&project_id=" + id : ""}` + `/exists?name=${encodedName}${id ? "&project_id=" + id : ""}` ); } diff --git a/epictrack-web/src/services/proponentService/proponentService.ts b/epictrack-web/src/services/proponentService/proponentService.ts index 549b80e19..fd0a2f6fb 100644 --- a/epictrack-web/src/services/proponentService/proponentService.ts +++ b/epictrack-web/src/services/proponentService/proponentService.ts @@ -31,9 +31,10 @@ class ProponentService implements ServiceBase { } async checkProponentExists(name: string, id: number) { + const encodedName = encodeURIComponent(name); return await http.GetRequest( Endpoints.Proponents.PROPONENTS + - `/exists?name=${name}${id ? "&proponent_id=" + id : ""}` + `/exists?name=${encodedName}${id ? "&proponent_id=" + id : ""}` ); } } diff --git a/epictrack-web/src/services/workService/workService.ts b/epictrack-web/src/services/workService/workService.ts index eaa782ce9..19da0dc6d 100644 --- a/epictrack-web/src/services/workService/workService.ts +++ b/epictrack-web/src/services/workService/workService.ts @@ -35,9 +35,10 @@ class WorkService implements ServiceBase { } async checkWorkExists(title: string, id?: string) { + const encodedTitle = encodeURIComponent(title); return await http.GetRequest( Endpoints.Works.WORKS + - `/exists?title=${title}${id ? "&work_id=" + id : ""}` + `/exists?title=${encodedTitle}${id ? "&work_id=" + id : ""}` ); }