Cleanup query string encoding on services API call

Signed-off-by: Dustin Brewer <mannkind@thenullpointer.net>
This commit is contained in:
Dustin Brewer
2023-03-10 16:00:32 +00:00
parent 078f46ea32
commit c5afe933bb
+3 -3
View File
@@ -81,10 +81,10 @@ export class FireHydrantAPIClient implements FireHydrantAPI {
lookupByName: boolean;
}): Promise<ServiceDetailsResponse> {
const queryOpt = options.lookupByName ? 'name' : 'query';
const query = new URLSearchParams();
query.set(queryOpt, options.serviceName);
const proxyUrl = await this.getApiUrl();
const response = await fetch(
`${proxyUrl}/services?${queryOpt}=${options.serviceName}`,
);
const response = await fetch(`${proxyUrl}/services?${query}`);
if (!response.ok) {
throw new Error(