diff --git a/src/lib/fetchwrapper.ts b/src/lib/fetchwrapper.ts index 08b28be..883e4f5 100644 --- a/src/lib/fetchwrapper.ts +++ b/src/lib/fetchwrapper.ts @@ -10,11 +10,11 @@ export default class FetchWrapper { this.timeout = timeout; } - addHeaders(newHeaders: Record) { + public addHeaders(newHeaders: Record) { this.defaults.headers = { ...this.defaults.headers, ...newHeaders }; } - async request( + public async request( endpoint: string, options: RequestInit = {} ): Promise { @@ -39,11 +39,14 @@ export default class FetchWrapper { } } - async get(endpoint: string, options: RequestInit = {}): Promise { + public async get( + endpoint: string, + options: RequestInit = {} + ): Promise { return this.request(endpoint, { ...options, method: "GET" }); } - async post( + public async post( endpoint: string, body: any, options: RequestInit = {} @@ -52,14 +55,14 @@ export default class FetchWrapper { return this.request(endpoint, { ...options, method: "POST", body }); } - async delete(endpoint: string, data: any): Promise { + public async delete(endpoint: string, data: any): Promise { return this.request(endpoint, { method: "DELETE", body: JSON.stringify(data), }); } - async put( + public async put( endpoint: string, body: any, options: RequestInit = {}