Fic declatation of baseUrl to ensure it includes /api/v3 whether provided or not.

This commit is contained in:
2026-02-21 00:18:44 +00:00
parent 4f13309cdc
commit 4fd95189ce

View File

@@ -8,10 +8,17 @@ export interface ApiResult<T> {
}
export class BaseClient {
protected readonly baseUrl: string;
constructor(
protected readonly baseUrl: string,
baseUrl: string,
protected readonly apiKey?: string
) {}
) {
const root = baseUrl.replace(/\/$/, '');
this.baseUrl = root.endsWith('/api/v3')
? root
: `${root}/api/v3`;
}
/**
* Handles the Envelope logic