Fic declatation of baseUrl to ensure it includes /api/v3 whether provided or not.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user