Skip to content

Commit

Permalink
(fix) Login app should load locations with a case-insensitive db (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher authored Jul 7, 2023
1 parent cd77ab4 commit c9c3f8f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/apps/esm-login-app/src/login.resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,27 @@ export function useLoginLocations(
return null;
}

let url = `${fhirBaseUrl}/Location?_summary=data`;
let url = `${fhirBaseUrl}/Location?`;
let urlSearchParameters = new URLSearchParams();
urlSearchParameters.append("_summary", "data");

if (count) {
url += `&_count=${count}`;
urlSearchParameters.append("_count", "" + count);
}

if (page) {
url += `&_getpagesoffset=${page * count}`;
urlSearchParameters.append("_getpagesoffset", "" + page * count);
}

if (useLoginLocationTag) {
url += "&_tag=login location";
urlSearchParameters.append("_tag", "Login Location");
}

if (typeof searchQuery === "string" && searchQuery != "") {
url += `&name:contains=${searchQuery}`;
urlSearchParameters.append("name:contains", searchQuery);
}

return url;
return url + urlSearchParameters.toString();
}

const { data, isLoading, isValidating, setSize, error } = useSwrInfinite<
Expand Down

0 comments on commit c9c3f8f

Please sign in to comment.