Skip to content

Commit c24e0c5

Browse files
CCM-12090: Wrap template ID in encodeURIComponent
1 parent f19285c commit c24e0c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lambdas/backend-client/src/template-api-client.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class TemplateApiClient {
8181
): Promise<Result<TemplateDto>> {
8282
const response = await catchAxiosError(
8383
this._client.post<TemplateSuccess>(
84-
`/v1/template/${templateId}`,
84+
`/v1/template/${encodeURIComponent(templateId)}`,
8585
template,
8686
{
8787
headers: { Authorization: token },
@@ -105,7 +105,7 @@ export class TemplateApiClient {
105105
token: string
106106
): Promise<Result<TemplateDto>> {
107107
const response = await catchAxiosError(
108-
this._client.get<TemplateSuccess>(`/v1/template/${templateId}`, {
108+
this._client.get<TemplateSuccess>(`/v1/template/${encodeURIComponent(templateId)}`, {
109109
headers: { Authorization: token },
110110
})
111111
);
@@ -172,7 +172,7 @@ export class TemplateApiClient {
172172
owner: string
173173
): Promise<Result<void>> {
174174
const response = await catchAxiosError(
175-
this._client.delete<TemplateSuccess>(`/v1/template/${templateId}`, {
175+
this._client.delete<TemplateSuccess>(`/v1/template/${encodeURIComponent(templateId)}`, {
176176
headers: {
177177
'Content-Type': 'application/json',
178178
Authorization: owner,
@@ -197,7 +197,7 @@ export class TemplateApiClient {
197197
): Promise<Result<TemplateDto>> {
198198
const response = await catchAxiosError(
199199
this._client.post<TemplateSuccess>(
200-
`/v1/template/${templateId}/proof`,
200+
`/v1/template/${encodeURIComponent(templateId)}/proof`,
201201
undefined,
202202
{
203203
headers: {

0 commit comments

Comments
 (0)