Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(question): change `adopt` to `accept`

haitao(lj)525dd2a18f0d
diff --git a/ui/src/pages/Admin/Answers/index.tsx b/ui/src/pages/Admin/Answers/index.tsx
index 805b1fbb..cf53e269 100644
--- a/ui/src/pages/Admin/Answers/index.tsx
+++ b/ui/src/pages/Admin/Answers/index.tsx
@@ -56,7 +56,7 @@ const Answers: FC = () => {
Modal.confirm({
title: t('title', { keyPrefix: 'delete' }),
content:
- item.adopted === 2
+ item.accepted === 2
? t('answer_accepted', { keyPrefix: 'delete' })
: `<p>${t('other', { keyPrefix: 'delete' })}</p>`,
cancelBtnVariant: 'link',
@@ -138,7 +138,7 @@ const Answers: FC = () => {
rel="noreferrer">
{li.question_info.title}
</a>
- {li.adopted === 2 && (
+ {li.accepted === 2 && (
<Icon
name="check-circle-fill"
className="ms-2 text-success"
diff --git a/ui/src/pages/Questions/Detail/components/Answer/index.tsx b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
index 6a63d624..3c88192a 100644
--- a/ui/src/pages/Questions/Detail/components/Answer/index.tsx
+++ b/ui/src/pages/Questions/Detail/components/Answer/index.tsx
@@ -44,7 +44,7 @@ const Index: FC<Props> = ({
const acceptAnswer = () => {
acceptanceAnswer({
question_id: data.question_id,
- answer_id: data.adopted === 2 ? '0' : data.id,
+ answer_id: data.accepted === 2 ? '0' : data.id,
}).then(() => {
callback?.('');
});
@@ -85,7 +85,7 @@ const Index: FC<Props> = ({
}}
/>
- {data?.adopted === 2 && (
+ {data?.accepted === 2 && (
<Button
disabled={!isAuthor}
variant="outline-success"
@@ -96,7 +96,7 @@ const Index: FC<Props> = ({
</Button>
)}
- {isAuthor && data.adopted === 1 && (
+ {isAuthor && data.accepted === 1 && (
<Button
variant="outline-success"
className="ms-3"
@@ -114,7 +114,7 @@ const Index: FC<Props> = ({
aid={data.id}
memberActions={data?.member_actions}
type="answer"
- isAccepted={data.adopted === 2}
+ isAccepted={data.accepted === 2}
title={questionTitle}
slugTitle={slugTitle}
callback={callback}
diff --git a/ui/src/pages/Users/Personal/components/Answers/index.tsx b/ui/src/pages/Users/Personal/components/Answers/index.tsx
index 0a5b2d92..383b09df 100644
--- a/ui/src/pages/Users/Personal/components/Answers/index.tsx
+++ b/ui/src/pages/Users/Personal/components/Answers/index.tsx
@@ -44,7 +44,7 @@ const Index: FC<Props> = ({ visible, data }) => {
<span>{item?.vote_count}</span>
</div>
- {item.adopted === 2 && (
+ {item.accepted === 2 && (
<div className="d-flex align-items-center me-3 text-success">
<Icon name="check-circle-fill me-1" />
<span>{t('accepted')}</span>
diff --git a/ui/src/pages/Users/Personal/components/TopList/index.tsx b/ui/src/pages/Users/Personal/components/TopList/index.tsx
index 92a66ddf..744a3f7b 100644
--- a/ui/src/pages/Users/Personal/components/TopList/index.tsx
+++ b/ui/src/pages/Users/Personal/components/TopList/index.tsx
@@ -51,7 +51,7 @@ const Index: FC<Props> = ({ data, type }) => {
</div>
)}
- {type === 'answer' && item.adopted === 2 && (
+ {type === 'answer' && item.accepted === 2 && (
<div className="d-inline-block text-success ms-3 fs-14">
<Icon name="check-circle-fill" />
<span> {t('accepted')}</span>