eddev 0.3.37 → 0.3.40

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.
@@ -208,12 +208,13 @@ function prepareValuesPayload(form, state, data) {
208
208
  data.append("".concat(key, "_8"), (_h = value === null || value === void 0 ? void 0 : value.suffix) !== null && _h !== void 0 ? _h : "");
209
209
  }
210
210
  else if (field.type === "address") {
211
- data.append("".concat(key, "_1"), (_j = value === null || value === void 0 ? void 0 : value.address1) !== null && _j !== void 0 ? _j : "");
212
- data.append("".concat(key, "_2"), (_k = value === null || value === void 0 ? void 0 : value.address2) !== null && _k !== void 0 ? _k : "");
213
- data.append("".concat(key, "_3"), (_l = value === null || value === void 0 ? void 0 : value.city) !== null && _l !== void 0 ? _l : "");
214
- data.append("".concat(key, "_4"), (_m = value === null || value === void 0 ? void 0 : value.state) !== null && _m !== void 0 ? _m : "");
215
- data.append("".concat(key, "_5"), (_o = value === null || value === void 0 ? void 0 : value.zip) !== null && _o !== void 0 ? _o : "");
216
- data.append("".concat(key, "_6"), (_p = value === null || value === void 0 ? void 0 : value.country) !== null && _p !== void 0 ? _p : "");
211
+ var id = field.id.toString();
212
+ data.append("".concat(key, "_1"), (_j = value["".concat(id, ".1")]) !== null && _j !== void 0 ? _j : "");
213
+ data.append("".concat(key, "_2"), (_k = value["".concat(id, ".2")]) !== null && _k !== void 0 ? _k : "");
214
+ data.append("".concat(key, "_3"), (_l = value["".concat(id, ".3")]) !== null && _l !== void 0 ? _l : "");
215
+ data.append("".concat(key, "_4"), (_m = value["".concat(id, ".4")]) !== null && _m !== void 0 ? _m : "");
216
+ data.append("".concat(key, "_5"), (_o = value["".concat(id, ".5")]) !== null && _o !== void 0 ? _o : "");
217
+ data.append("".concat(key, "_6"), (_p = value["".concat(id, ".6")]) !== null && _p !== void 0 ? _p : "");
217
218
  }
218
219
  else if (field.type === "captcha") {
219
220
  data.append("g-recaptcha-response", value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "0.3.37",
3
+ "version": "0.3.40",
4
4
  "main": "./index.js",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -18,7 +18,7 @@ const validProxyPaths = {
18
18
 
19
19
  export default async function (req: NextApiRequest, res: NextApiResponse) {
20
20
  // Ensure that the request is for a proxy path
21
- const proxyPath = validProxyPaths[req.query.method[0] as keyof typeof validProxyPaths]!
21
+ const proxyPath = validProxyPaths[req.query.method![0] as keyof typeof validProxyPaths]!
22
22
 
23
23
  if (!proxyPath) {
24
24
  return res.status(404).json({
@@ -36,9 +36,14 @@ export default async function (req: NextApiRequest, res: NextApiResponse) {
36
36
  {
37
37
  method: proxyPath.method,
38
38
  headers: {
39
- "Content-Type": "application/json",
39
+ "Content-Type": req.headers["content-type"] ?? "application/json",
40
40
  },
41
- body: proxyPath.method === "POST" ? JSON.stringify(req.body) : undefined,
41
+ body:
42
+ proxyPath.method === "POST"
43
+ ? req.headers["content-type"] === "application/json"
44
+ ? JSON.stringify(req.body)
45
+ : req.body
46
+ : undefined,
42
47
  },
43
48
  async (response) => ({
44
49
  payload: await response.json(),