Tidy up seting CloudClient#fetch

This commit is contained in:
Caleb Owens 2024-04-09 17:52:59 +01:00 committed by Mattias Granlund
parent c094d7e1ee
commit b7ac4cc41e

View File

@ -67,12 +67,7 @@ interface EvaluatePromptParams {
}
export class CloudClient {
fetch: ((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>) &
((input: RequestInfo | URL, init?: RequestInit | undefined) => Promise<Response>);
constructor(fetch: typeof window.fetch = window.fetch) {
this.fetch = fetch;
}
constructor(public fetch = window.fetch) {}
async createLoginToken(): Promise<LoginToken> {
const response = await this.fetch(getUrl('login/token.json'), {