Update http request function

This commit is contained in:
Benjamin Toby
2025-01-09 06:41:06 +01:00
parent e28cf872ea
commit 4bda9149c6
4 changed files with 38 additions and 12 deletions
+9 -3
View File
@@ -1235,7 +1235,13 @@ export type HttpRequestParams = RequestOptions & {
};
urlEncodedFormBody?: boolean;
};
export type HttpRequestFunctionType = (param: HttpRequestParams) => Promise<{
[key: string]: any;
} | string | null>;
export type HttpRequestFunctionType = (param: HttpRequestParams) => Promise<HttpFunctionResponse>;
export type HttpFunctionResponse = {
status: number;
data?: {
[key: string]: any;
};
error?: string;
str?: string;
};
export {};
+8 -1
View File
@@ -1453,4 +1453,11 @@ export type HttpRequestParams = RequestOptions & {
export type HttpRequestFunctionType = (
param: HttpRequestParams
) => Promise<{ [key: string]: any } | string | null>;
) => Promise<HttpFunctionResponse>;
export type HttpFunctionResponse = {
status: number;
data?: { [key: string]: any };
error?: string;
str?: string;
};