gatsby-core-theme 44.4.14 → 44.4.15

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,3 +1,11 @@
1
+ ## [44.4.15](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.14...v44.4.15) (2025-07-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * client side submission ([3b85150](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3b851500bc00299ded69c8a546b7a87f7edf5344))
7
+ * re added api server routes ([3acad8c](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/3acad8c75f35dfa81a246faa135ef1e4f4f455dc))
8
+
1
9
  ## [44.4.14](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.13...v44.4.14) (2025-07-17)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gatsby-core-theme",
3
- "version": "44.4.14",
3
+ "version": "44.4.15",
4
4
  "description": "Gatsby Theme NPM Package",
5
5
  "author": "",
6
6
  "license": "ISC",
@@ -14,6 +14,7 @@ const LeaveCommentForm = ({
14
14
  showLabels = true,
15
15
  showButtonIcon = false,
16
16
  buttonLabel = 'Add Comment',
17
+ // submitUrl = `${process.env.GATSBY_API_URL_V2}/content/v0.1/comments`,
17
18
  successMessage = 'Comment Added',
18
19
  failMessage = 'Comment Not Added',
19
20
  validationMessage = 'Fill all required fields',
@@ -25,26 +26,30 @@ const LeaveCommentForm = ({
25
26
  const formData = new FormData(form);
26
27
  const data = Object.fromEntries(formData.entries());
27
28
 
28
- if(data?.["g-recaptcha-response"] === '' || !data?.tnc) return;
29
+ // if(data?.["g-recaptcha-response"] === '' || !data?.tnc) return;
29
30
 
30
31
  data.reference_id = page?.id;
31
32
  data.site_id = parseInt(process.env.SITE_ID);
32
33
  data.rate = parseInt(data.rate);
33
34
 
34
35
  data.market_short_code = activeMarket;
35
- delete data["g-recaptcha-response"];
36
36
 
37
37
  if(data?.post_anonymously) delete data?.name;
38
38
  delete data?.post_anonymously;
39
39
  delete data?.tnc;
40
40
 
41
+ const headers = {
42
+ headers: {
43
+ "Content-Type": "application/json",
44
+ Accept: "application/json",
45
+ },
46
+ };
47
+
41
48
  return new Promise((resolve, reject) => {
42
49
  axios
43
- .post("/api/post-comment", data)
44
- .then((res) => resolve(res.data))
45
- .catch((err) =>
46
- reject(err?.response?.data?.message || "Something went wrong")
47
- );
50
+ .post('/api/post-comment', data, headers)
51
+ .then((response) => resolve(response.data.result))
52
+ .catch((error) => reject(error?.response?.data?.errors?.join() || error.message));
48
53
  });
49
54
  };
50
55
 
@@ -74,6 +79,7 @@ LeaveCommentForm.propTypes = {
74
79
  id: PropTypes.number,
75
80
  path: PropTypes.string,
76
81
  }).isRequired,
82
+ // submitUrl: PropTypes.string,
77
83
  successMessage: PropTypes.string,
78
84
  failMessage: PropTypes.string,
79
85
  validationMessage: PropTypes.string,