react-query-lightbase-codegen 2.5.1 → 2.5.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.
@@ -105,7 +105,7 @@ function generateAxiosMethod(operation, spec) {
105
105
  ? "axiosConfig.headers = { ...axiosConfig.headers, 'Content-Type': 'multipart/form-data' };"
106
106
  : "",
107
107
  requestBody
108
- ? `const res = await apiClient.${method}<${responseType}>(url, ${formDataSchema?.properties ? "bodyData" : "data"}, axiosConfig);`
108
+ ? `const res = await apiClient.${method}<${responseType}>(url, ${formDataSchema?.properties || requestBodySchema?.properties ? "bodyData" : "data"}, axiosConfig);`
109
109
  : `const res = await apiClient.${method}<${responseType}>(url, axiosConfig);`,
110
110
  "return res.data;",
111
111
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-query-lightbase-codegen",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "license": "MIT",
5
5
  "description": "Generate Axios API clients and React Query options from OpenAPI specifications",
6
6
  "exports": "./dist/index.js",
@@ -137,7 +137,7 @@ function generateAxiosMethod(operation: OperationInfo, spec: OpenAPIV3.Document)
137
137
  ? "axiosConfig.headers = { ...axiosConfig.headers, 'Content-Type': 'multipart/form-data' };"
138
138
  : "",
139
139
  requestBody
140
- ? `const res = await apiClient.${method}<${responseType}>(url, ${formDataSchema?.properties ? "bodyData" : "data"}, axiosConfig);`
140
+ ? `const res = await apiClient.${method}<${responseType}>(url, ${formDataSchema?.properties || requestBodySchema?.properties ? "bodyData" : "data"}, axiosConfig);`
141
141
  : `const res = await apiClient.${method}<${responseType}>(url, axiosConfig);`,
142
142
  "return res.data;",
143
143
  ]