@blocklet/discuss-kit 2.3.60 → 2.3.62

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/lib/cjs/api.js CHANGED
@@ -29,8 +29,8 @@ const fetchComments = async (params) => {
29
29
  throw e;
30
30
  }
31
31
  };
32
- const reply = async ({ commentId, parentId, content }) => {
33
- const { data } = await request.post(`/comments/${commentId}/replies`, { content, parentId });
32
+ const reply = async ({ parentId, content }) => {
33
+ const { data } = await request.post("/comments/replies", { content, parentId });
34
34
  return data;
35
35
  };
36
36
  const fetchMoreReplies = async ({ commentId, cursor, limit = 10 }) => {
@@ -67,8 +67,8 @@ const commentAPI = {
67
67
  const { data } = await api.put(`/comments/${id}`, { content, updatedAt });
68
68
  return formatComment(data);
69
69
  },
70
- reply: async ({ id, rootId }, content) => {
71
- const { data } = await api.post(`/comments/${rootId || id}/replies`, {
70
+ reply: async ({ id }, content) => {
71
+ const { data } = await api.post("/comments/replies", {
72
72
  content,
73
73
  parentId: id,
74
74
  link: window.location.href
package/lib/es/api.js CHANGED
@@ -27,8 +27,8 @@ const fetchComments = async (params) => {
27
27
  throw e;
28
28
  }
29
29
  };
30
- const reply = async ({ commentId, parentId, content }) => {
31
- const { data } = await request.post(`/comments/${commentId}/replies`, { content, parentId });
30
+ const reply = async ({ parentId, content }) => {
31
+ const { data } = await request.post("/comments/replies", { content, parentId });
32
32
  return data;
33
33
  };
34
34
  const fetchMoreReplies = async ({ commentId, cursor, limit = 10 }) => {
@@ -66,8 +66,8 @@ const commentAPI = {
66
66
  const { data } = await api.put(`/comments/${id}`, { content, updatedAt });
67
67
  return formatComment(data);
68
68
  },
69
- reply: async ({ id, rootId }, content) => {
70
- const { data } = await api.post(`/comments/${rootId || id}/replies`, {
69
+ reply: async ({ id }, content) => {
70
+ const { data } = await api.post("/comments/replies", {
71
71
  content,
72
72
  parentId: id,
73
73
  link: window.location.href
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit",
3
- "version": "2.3.60",
3
+ "version": "2.3.62",
4
4
  "description": "A react component for Discuss Kit blocklet.",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/es/index.js",
@@ -49,8 +49,8 @@
49
49
  "rehype-sanitize": "^5.0.1",
50
50
  "timeago.js": "^4.0.2",
51
51
  "url-join": "^4.0.1",
52
- "@blocklet/discuss-kit-ux": "^2.3.60",
53
- "@blocklet/editor": "^2.3.60"
52
+ "@blocklet/discuss-kit-ux": "^2.3.62",
53
+ "@blocklet/editor": "^2.3.62"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@arcblock/did-connect": "^2.10.36",