Skip to content

Commit

Permalink
refactor: use set method for URL search parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
infacc committed Aug 1, 2023
1 parent a0b8606 commit 58fa077
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/app/services/registry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,11 +484,7 @@ export class PluginRegistryBaseService {
public async getByApiLink<T>(link: ApiLink, searchParams: URLSearchParams | null = null, ignoreCache: boolean | "ignore-embedded" = false): Promise<ApiResponse<T> | null> {
const url = new URL(link.href)
searchParams?.forEach((value, key) => {
if (url.searchParams.has(key)) {
url.searchParams.set(key, value);
} else {
url.searchParams.append(key, value);
}
url.searchParams.set(key, value);
});
return await this._fetch<ApiResponse<T>>(url.toString(), ignoreCache);
}
Expand Down

0 comments on commit 58fa077

Please sign in to comment.