WIP ESLint fixes
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-12-03 11:16:14 +01:00
parent 1090a59aaf
commit bbf558bbf9
10 changed files with 86 additions and 78 deletions

View File

@@ -4,21 +4,21 @@ interface RequestParams {
uri: string;
method: "GET" | "POST" | "DELETE" | "PATCH" | "PUT";
allowFail?: boolean;
jsonData?: any;
jsonData?: unknown;
formData?: FormData;
upProgress?: (progress: number) => void;
downProgress?: (e: { progress: number; total: number }) => void;
}
interface APIResponse {
data: any;
data: unknown;
status: number;
}
export class ApiError extends Error {
public code: number;
public data: number;
constructor(message: string, code: number, data: any) {
public data: unknown;
constructor(message: string, code: number, data: unknown) {
super(`HTTP status: ${code}\nMessage: ${message}\nData=${data}`);
this.code = code;
this.data = data;
@@ -57,6 +57,7 @@ export class APIClient {
*/
static async exec(args: RequestParams): Promise<APIResponse> {
let body: string | undefined | FormData = undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const headers: any = {};
// JSON request