From 8d2c806176412f0b0aa84229f7751f38e9e5b288 Mon Sep 17 00:00:00 2001 From: KristoferPervin <7747148+kpervin@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:46:00 -0400 Subject: [PATCH 1/2] feat: exposed multipart-body axios functions --- lib/http.service.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lib/http.service.ts b/lib/http.service.ts index ab1dc242..8d55c063 100644 --- a/lib/http.service.ts +++ b/lib/http.service.ts @@ -64,6 +64,45 @@ export class HttpService { return this.makeObservable(this.instance.patch, url, data, config); } + postForm( + url: string, + data: D, + config?: AxiosRequestConfig, + ): Observable>; + postForm( + url: string, + data?: any, + config?: AxiosRequestConfig, + ): Observable> { + return this.makeObservable(this.instance.postForm, url, data, config); + } + + putForm( + url: string, + data: D, + config?: AxiosRequestConfig, + ): Observable>; + putForm( + url: string, + data?: any, + config?: AxiosRequestConfig, + ): Observable> { + return this.makeObservable(this.instance.putForm, url, data, config); + } + + patchForm( + url: string, + data: D, + config?: AxiosRequestConfig, + ): Observable>; + patchForm( + url: string, + data?: any, + config?: AxiosRequestConfig, + ): Observable> { + return this.makeObservable(this.instance.patchForm, url, data, config); + } + get axiosRef(): AxiosInstance { return this.instance; } From cdd7ce3ef84a96fce355a746f05d2f4464646d6e Mon Sep 17 00:00:00 2001 From: KristoferPervin <7747148+kpervin@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:57:34 -0400 Subject: [PATCH 2/2] fix: added data type to response type --- lib/http.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/http.service.ts b/lib/http.service.ts index 8d55c063..d57d21cf 100644 --- a/lib/http.service.ts +++ b/lib/http.service.ts @@ -68,7 +68,7 @@ export class HttpService { url: string, data: D, config?: AxiosRequestConfig, - ): Observable>; + ): Observable>; postForm( url: string, data?: any, @@ -81,7 +81,7 @@ export class HttpService { url: string, data: D, config?: AxiosRequestConfig, - ): Observable>; + ): Observable>; putForm( url: string, data?: any, @@ -94,7 +94,7 @@ export class HttpService { url: string, data: D, config?: AxiosRequestConfig, - ): Observable>; + ): Observable>; patchForm( url: string, data?: any,