Skip to content

Commit

Permalink
fix: HttpService.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Murzbul committed Aug 14, 2023
1 parent d4352b9 commit 80db03a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/HttpService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ class HttpService
{
const { url, method, queryParams, data } = params;

const test: URLSearchParams = getParams(queryParams);
const urlWithParams = `${url}?${test.toString()}`; // Convierte los parámetros en formato de cadena
const finalUrl = urlWithParams.replace(/%5B/g, '[').replace(/%5D/g, ']'); // Reemplaza los códigos ASCII por corchetes
const params: URLSearchParams = getParams(queryParams);
const urlWithParams = `${url}?${params.toString()}`; // Params to string
const finalUrl = urlWithParams.replace(/%5B/g, '[').replace(/%5D/g, ']'); // Reeplace ASCII code to brackets

const response = await fetch(finalUrl, {
method,
Expand Down

0 comments on commit 80db03a

Please sign in to comment.