chore:little fixes and formating and linting and patches
This commit is contained in:
@@ -44,7 +44,7 @@ export class Api {
|
||||
url: string,
|
||||
data: ReqBody,
|
||||
options: FetchOptions,
|
||||
attempt: number,
|
||||
attempt: number
|
||||
): Promise<ResBody | null> {
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
@@ -55,7 +55,9 @@ export class Api {
|
||||
...options,
|
||||
});
|
||||
|
||||
if (response.status === 401) return null;
|
||||
if (response.status === 401) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (response.status !== 200 && response.status !== 202) {
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
@@ -77,7 +79,7 @@ export class Api {
|
||||
async fetch<ReqBody, ResBody>(
|
||||
path: string,
|
||||
data: ReqBody,
|
||||
options: FetchOptions = {},
|
||||
options: FetchOptions = {}
|
||||
): Promise<ResBody | null> {
|
||||
const url = `${this.baseUrl}${path}`;
|
||||
return this.post<ReqBody, ResBody>(url, data, options, 0);
|
||||
|
||||
Reference in New Issue
Block a user