@akinon/next 1.45.0-rc.3 → 1.45.0-rc.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.45.0-rc.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 8f47cca: ZERO-2829: fix and add nested JSON support for useFormData in api/client route
8
+
3
9
  ## 1.45.0-rc.3
4
10
 
5
11
  ### Minor Changes
package/api/client.ts CHANGED
@@ -93,7 +93,9 @@ async function proxyRequest(...args) {
93
93
  fetchOptions.headers['Content-Type'] = options.contentType;
94
94
  }
95
95
 
96
- const isMultipartFormData = req.headers.get('content-type')?.includes('multipart/form-data;');
96
+ const isMultipartFormData = req.headers
97
+ .get('content-type')
98
+ ?.includes('multipart/form-data;');
97
99
 
98
100
  if (req.method !== 'GET') {
99
101
  let body: Record<string, any> | FormData = {};
@@ -117,7 +119,11 @@ async function proxyRequest(...args) {
117
119
 
118
120
  Object.keys(body ?? {}).forEach((key) => {
119
121
  if (body[key]) {
120
- formData.append(key, body[key]);
122
+ if (typeof body[key] === 'object' && body[key] !== null) {
123
+ formData.append(key, JSON.stringify(body[key]));
124
+ } else {
125
+ formData.append(key, body[key]);
126
+ }
121
127
  }
122
128
  });
123
129
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "1.45.0-rc.3",
4
+ "version": "1.45.0-rc.4",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "set-cookie-parser": "2.6.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@akinon/eslint-plugin-projectzero": "1.45.0-rc.3",
33
+ "@akinon/eslint-plugin-projectzero": "1.45.0-rc.4",
34
34
  "@types/react-redux": "7.1.30",
35
35
  "@types/set-cookie-parser": "2.4.7",
36
36
  "@typescript-eslint/eslint-plugin": "6.7.4",