We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1f68a93 commit 87fed0aCopy full SHA for 87fed0a
src/utils/api.ts
@@ -77,8 +77,11 @@ export function getDefaultApiBaseUrl(): string | undefined {
77
}
78
79
export async function queryApi(path: string, apiToken: string) {
80
- const API_V0_URL = getDefaultApiBaseUrl()
81
- return await fetch(`${API_V0_URL}/${path}`, {
+ const API_V0_URL = getDefaultApiBaseUrl() || ''
+ if (!API_V0_URL) {
82
+ logger.warn('API endpoint is not set and default was empty. Request is likely to fail.')
83
+ }
84
+ return await fetch(`${API_V0_URL}${API_V0_URL.endsWith('/')?'':'/'}${path}`, {
85
method: 'GET',
86
headers: {
87
Authorization: `Basic ${btoa(`${apiToken}:`)}`
0 commit comments