refactor: resolving PR comments

Reverting get() baseUrl overwrite in favour of a vanilla fetch() call

#943
This commit is contained in:
Hermanus Engelbrecht
2024-08-28 19:45:20 +02:00
parent 0e588bf315
commit a5979933f8
2 changed files with 25 additions and 17 deletions

View File

@@ -47,8 +47,7 @@ class ExternalAPI {
endpoint: string,
params?: Record<string, string>,
ttl?: number,
config?: RequestInit,
overwriteBaseUrl?: string
config?: RequestInit
): Promise<T> {
const cacheKey = this.serializeCacheKey(endpoint, {
...this.params,
@@ -59,7 +58,7 @@ class ExternalAPI {
return cachedItem;
}
const url = this.formatUrl(endpoint, params, overwriteBaseUrl);
const url = this.formatUrl(endpoint, params);
const response = await this.fetch(url, {
...config,
headers: {