Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Rename variable to be less confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien0102 committed Apr 16, 2019
1 parent 0d75fd7 commit 40e7e9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/useGet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ export interface UseGetProps<TData, TQueryParams> {
}

function resolvePath<TQueryParams>(base: string, path: string, queryParams: TQueryParams) {
const escapedBase = base.endsWith("/") ? base : `${base}/`;
const escapedPath = path.startsWith("/") ? path.slice(1) : path;
const appendedBase = base.endsWith("/") ? base : `${base}/`;
const trimmedPath = path.startsWith("/") ? path.slice(1) : path;

return url.resolve(escapedBase, queryParams ? `${escapedPath}?${qs.stringify(queryParams)}` : escapedPath);
return url.resolve(appendedBase, queryParams ? `${trimmedPath}?${qs.stringify(queryParams)}` : trimmedPath);
}

async function _fetchData<TData, TError, TQueryParams>(
Expand Down

0 comments on commit 40e7e9b

Please sign in to comment.