@ventlio/tanstack-query 0.2.63-beta.1 → 0.2.63-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -201,7 +201,7 @@ const successTransformer = (data) => {
201
201
 
202
202
  async function makeRequest({ body, method = HttpMethod.GET, path, isFormData, headers = {}, baseURL, timeout, }) {
203
203
  // configure body
204
- body = isFormData ? buildFormData(body) : body;
204
+ body = isFormData ? axios.toFormData(body) : body;
205
205
  // configure request header
206
206
  if (!isFormData) {
207
207
  headers['Content-Type'] = ContentType.APPLICATION_JSON;
@@ -1,11 +1,11 @@
1
+ import axios from 'axios';
1
2
  import { axiosInstance } from './axios-instance.js';
2
- import { buildFormData } from './buildFormData.js';
3
3
  import { ContentType, HttpMethod } from './request.enum.js';
4
4
  import { errorTransformer, successTransformer } from './transformer.js';
5
5
 
6
6
  async function makeRequest({ body, method = HttpMethod.GET, path, isFormData, headers = {}, baseURL, timeout, }) {
7
7
  // configure body
8
- body = isFormData ? buildFormData(body) : body;
8
+ body = isFormData ? axios.toFormData(body) : body;
9
9
  // configure request header
10
10
  if (!isFormData) {
11
11
  headers['Content-Type'] = ContentType.APPLICATION_JSON;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ventlio/tanstack-query",
3
- "version": "0.2.63-beta.1",
3
+ "version": "0.2.63-beta.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
+ import axios from 'axios';
1
2
  import { axiosInstance } from './axios-instance';
2
3
 
3
- import { buildFormData } from './buildFormData';
4
4
  import { ContentType, HttpMethod } from './request.enum';
5
5
  import type { IMakeRequest } from './request.interface';
6
6
  import { errorTransformer, successTransformer } from './transformer';
@@ -15,7 +15,7 @@ export async function makeRequest<TResponse>({
15
15
  timeout,
16
16
  }: IMakeRequest) {
17
17
  // configure body
18
- body = isFormData ? buildFormData(body as Record<string, any>) : body;
18
+ body = isFormData ? axios.toFormData(body as Record<string, any>) : body;
19
19
 
20
20
  // configure request header
21
21
  if (!isFormData) {