gatsby-core-theme 44.4.8 → 44.4.10
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,18 @@
|
|
|
1
|
+
## [44.4.10](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.9...v44.4.10) (2025-07-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added axios to requests ([56d8110](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/56d81105fcff189355cb05286e218fc23362af58))
|
|
7
|
+
|
|
8
|
+
## [44.4.9](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.8...v44.4.9) (2025-07-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* endpoints ([c9c68d0](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/c9c68d0aacd4a67ba425ae2c6a06c1d7e0412724))
|
|
14
|
+
* moved to core endpoints with authentication ([2738d70](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/commit/2738d702d9fc90f9e8c00b9f3c09a786af0ebe42))
|
|
15
|
+
|
|
1
16
|
## [44.4.8](https://gitlab.com/g2m-gentoo/team-floyd/themes/gatsby-themes/compare/v44.4.7...v44.4.8) (2025-07-15)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
4
4
|
/* eslint-disable import/no-extraneous-dependencies */
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import axios from 'axios';
|
|
6
7
|
import PropTypes from 'prop-types';
|
|
7
8
|
import LazyImage from '~hooks/lazy-image';
|
|
8
9
|
|
|
@@ -24,26 +25,23 @@ const Comment = ({ comment, authors, isReply }) => {
|
|
|
24
25
|
const handleVote = async (like = false, commentId) => {
|
|
25
26
|
const data = like ? {"vote_up": "increase"} : {"vote_down": "increase"};
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
Accept: 'application/json',
|
|
36
|
-
},
|
|
37
|
-
body: JSON.stringify(data),
|
|
38
|
-
}
|
|
39
|
-
);
|
|
28
|
+
const headers = {
|
|
29
|
+
headers: {
|
|
30
|
+
"X-ID": process.env.GATSBY_API_V2_X_ID,
|
|
31
|
+
"X-Signature": process.env.GATSBY_API_V2_X_SIGNATURE,
|
|
32
|
+
"Content-Type": "application/json",
|
|
33
|
+
Accept: "application/json",
|
|
34
|
+
},
|
|
35
|
+
};
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
const path = `${process.env.GATSBY_API_URL_V2}/content/v0.1/comments/votes/${commentId}`;
|
|
38
|
+
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
axios
|
|
41
|
+
.post(path, data, headers)
|
|
42
|
+
.then((response) => resolve(response.data.result))
|
|
43
|
+
.catch((error) => reject(error?.response?.data?.errors?.join() || error.message));
|
|
44
|
+
});
|
|
47
45
|
}
|
|
48
46
|
|
|
49
47
|
return <div className={`${styles.commentContainer} ${isReply ? styles.isReply : ''}`}>
|
|
@@ -2,7 +2,7 @@
|
|
|
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
|
-
|
|
5
|
+
import axios from "axios";
|
|
6
6
|
import Form from "gatsby-core-theme/src/components/organisms/form";
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { FaArrowRight } from '@react-icons/all-files/fa/FaArrowRight';
|
|
@@ -14,7 +14,7 @@ const LeaveCommentForm = ({
|
|
|
14
14
|
showLabels = true,
|
|
15
15
|
showButtonIcon = false,
|
|
16
16
|
buttonLabel = 'Add Comment',
|
|
17
|
-
submitUrl = `${process.env.
|
|
17
|
+
submitUrl = `${process.env.GATSBY_API_URL_V2}/content/v0.1/comments`,
|
|
18
18
|
successMessage = 'Comment Added',
|
|
19
19
|
failMessage = 'Comment Not Added',
|
|
20
20
|
validationMessage = 'Fill all required fields',
|
|
@@ -39,11 +39,20 @@ const LeaveCommentForm = ({
|
|
|
39
39
|
delete data?.post_anonymously;
|
|
40
40
|
delete data?.tnc;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
const headers = {
|
|
43
|
+
headers: {
|
|
44
|
+
"X-ID": process.env.GATSBY_API_V2_X_ID,
|
|
45
|
+
"X-Signature": process.env.GATSBY_API_V2_X_SIGNATURE,
|
|
46
|
+
"Content-Type": "application/json",
|
|
47
|
+
Accept: "application/json",
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
axios
|
|
53
|
+
.post(submitUrl, data, headers)
|
|
54
|
+
.then((response) => resolve(response.data.result))
|
|
55
|
+
.catch((error) => reject(error?.response?.data?.errors?.join() || error.message));
|
|
47
56
|
});
|
|
48
57
|
};
|
|
49
58
|
|