gatsby-core-theme 44.4.59 → 44.4.60
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,10 @@
|
|
|
1
|
+
## [44.4.60](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.59...v44.4.60) (2025-10-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* improve comment logic ([f1786b8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/f1786b87f4705fea44dad32cd058734c65db6a5b))
|
|
7
|
+
|
|
1
8
|
## [44.4.59](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.58...v44.4.59) (2025-10-01)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
5
5
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
6
6
|
import React, { useContext } from 'react';
|
|
7
|
-
import axios from 'axios';
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
9
8
|
import LazyImage from '~hooks/lazy-image';
|
|
10
9
|
import useTranslate from '~hooks/useTranslate/useTranslate';
|
|
@@ -31,21 +30,23 @@ const CommentVotes = ({
|
|
|
31
30
|
"commentID": commentId
|
|
32
31
|
};
|
|
33
32
|
|
|
34
|
-
const headers = {
|
|
35
|
-
headers: {
|
|
36
|
-
"Content-Type": "application/json",
|
|
37
|
-
Accept: "application/json",
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
33
|
return new Promise((resolve, reject) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
fetch(`${process.env.GATSBY_API_COMMENT_URL}/api/put-vote`, {
|
|
35
|
+
method: 'PUT',
|
|
36
|
+
headers: {
|
|
37
|
+
'Content-Type': 'application/json',
|
|
38
|
+
},
|
|
39
|
+
body: JSON.stringify(data),
|
|
40
|
+
})
|
|
41
|
+
.then(async (response) => {
|
|
42
|
+
if (response.ok) {
|
|
43
|
+
resolve(response);
|
|
44
|
+
} else {
|
|
45
|
+
const errorData = await response.json().catch(() => ({}));
|
|
46
|
+
reject(errorData?.errors?.join() || response.statusText);
|
|
47
|
+
}
|
|
47
48
|
})
|
|
48
|
-
.catch((error) => reject(error
|
|
49
|
+
.catch((error) => reject(error.message));
|
|
49
50
|
});
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
3
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import axios from "axios";
|
|
6
5
|
import Form from "gatsby-core-theme/src/components/organisms/form";
|
|
7
6
|
import PropTypes from 'prop-types';
|
|
8
7
|
import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
|
|
@@ -52,22 +51,24 @@ const LeaveCommentForm = ({
|
|
|
52
51
|
delete cleanedData?.post_anonymously;
|
|
53
52
|
delete cleanedData?.tnc;
|
|
54
53
|
|
|
55
|
-
const headers = {
|
|
56
|
-
headers: {
|
|
57
|
-
"Content-Type": "application/json",
|
|
58
|
-
Accept: "application/json",
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
|
|
62
54
|
return new Promise((resolve, reject) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
fetch(`${process.env.GATSBY_API_COMMENT_URL}/api/post-comment`, {
|
|
56
|
+
method: 'POST',
|
|
57
|
+
headers: {
|
|
58
|
+
'Content-Type': 'application/json',
|
|
59
|
+
},
|
|
60
|
+
body: JSON.stringify(cleanedData),
|
|
61
|
+
})
|
|
62
|
+
.then(async (response) => {
|
|
63
|
+
if (response.ok) {
|
|
64
|
+
resetForm();
|
|
65
|
+
resolve(response);
|
|
66
|
+
} else {
|
|
67
|
+
const errorData = await response.json().catch(() => ({}));
|
|
68
|
+
reject(errorData?.errors?.join() || response.statusText);
|
|
69
|
+
}
|
|
69
70
|
})
|
|
70
|
-
.catch((error) => reject(error
|
|
71
|
+
.catch((error) => reject(error.message));
|
|
71
72
|
});
|
|
72
73
|
};
|
|
73
74
|
|