Skip to content

Commit 504356f

Browse files
committed
lint
1 parent 6af1018 commit 504356f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/api/base_api.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export abstract class BaseApi {
3333
/**
3434
* CONSTRUCTOR
3535
*/
36-
protected constructor(name: string, urlBase: string, minimumDelay: number = 1000, timeout: number = 10000) {
36+
protected constructor (name: string, urlBase: string, minimumDelay: number = 1000, timeout: number = 10000) {
3737
this.name = name
3838
this.urlBase = urlBase
3939
this.timeout = timeout
@@ -45,7 +45,7 @@ export abstract class BaseApi {
4545
})
4646
}
4747

48-
cleanUrlParamString(word: string): string {
48+
cleanUrlParamString (word: string): string {
4949
return word.replace(/\s/g, '%20').replace(/and/gi, '%26')
5050
}
5151

@@ -54,7 +54,7 @@ export abstract class BaseApi {
5454
*/
5555
_axiosInstance: AxiosInstance
5656

57-
protected get client(): AxiosInstance {
57+
protected get client (): AxiosInstance {
5858
return this._axiosInstance
5959
}
6060

@@ -67,28 +67,28 @@ export abstract class BaseApi {
6767
* Supported methods
6868
* - GET, POST, PATCH, DELETE
6969
*/
70-
protected async httpGet(url: string, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
70+
protected async httpGet (url: string, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
7171
this.loading = true
7272
const response = await this.catchDuplicates(async () => await this.client.get(url, { headers }), url)
7373
this.loading = false
7474
return response
7575
}
7676

77-
protected async httpPost(url: string, body: object, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
77+
protected async httpPost (url: string, body: object, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
7878
this.loading = true
7979
const response = await this.catchDuplicates(async () => await this.client.post(url, body, { headers }), url)
8080
this.loading = false
8181
return response
8282
}
8383

84-
protected async httpPatch(url: string, body: object, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
84+
protected async httpPatch (url: string, body: object, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
8585
this.loading = true
8686
const response = await this.catchDuplicates(async () => await this.client.patch(url, body, { headers }), url)
8787
this.loading = false
8888
return response
8989
}
9090

91-
protected async httpDelete(url: string, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
91+
protected async httpDelete (url: string, headers: AxiosRequestConfig['headers'] = {}): Promise<ApiResponse<unknown>> {
9292
this.loading = true
9393
const response = await this.catchDuplicates(async () => await this.client.delete(url, { headers }), url)
9494
this.loading = false
@@ -135,7 +135,7 @@ export abstract class BaseApi {
135135
return response
136136
} catch (error) {
137137
console.error(`Error in ${this.name} for URL ${urlToCall}:`, error)
138-
return new ApiResponseError<T>({} as AxiosResponse)
138+
return new ApiResponseError<T>({} as const as AxiosResponse<T>)
139139
}
140140
}
141-
}
141+
}

0 commit comments

Comments
 (0)