This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch refactor/collection
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/refactor/collection by this 
push:
     new ac18f302 fix: bookmark params changed
ac18f302 is described below

commit ac18f302a6e6eaaaa1f157165bcad607afb2c575
Author: shuai <[email protected]>
AuthorDate: Tue Nov 28 18:00:01 2023 +0800

    fix: bookmark params changed
---
 ui/src/components/Actions/index.tsx | 3 ++-
 ui/src/services/common.ts           | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ui/src/components/Actions/index.tsx 
b/ui/src/components/Actions/index.tsx
index 1ea00b0a..b8357105 100644
--- a/ui/src/components/Actions/index.tsx
+++ b/ui/src/components/Actions/index.tsx
@@ -125,9 +125,10 @@ const Index: FC<Props> = ({ className, data, source }) => {
     bookmark({
       group_id: '0',
       object_id: data?.id,
+      bookmark: !bookmarkState.state,
     }).then((res) => {
       setBookmark({
-        state: res.switch,
+        state: !bookmarkState.state,
         count: res.object_collection_count,
       });
     });
diff --git a/ui/src/services/common.ts b/ui/src/services/common.ts
index f4efca73..251961d6 100644
--- a/ui/src/services/common.ts
+++ b/ui/src/services/common.ts
@@ -200,7 +200,11 @@ export const postAnswer = (params: Type.PostAnswerReq) => {
   return request.post('/answer/api/v1/answer', params);
 };
 
-export const bookmark = (params: { group_id: string; object_id: string }) => {
+export const bookmark = (params: {
+  group_id: string;
+  object_id: string;
+  bookmark: boolean;
+}) => {
   return request.post('/answer/api/v1/collection/switch', params);
 };
 

Reply via email to