diff --git a/ui/src/components/Operate/index.tsx b/ui/src/components/Operate/index.tsx index 57d513ed..18ce6a22 100644 --- a/ui/src/components/Operate/index.tsx +++ b/ui/src/components/Operate/index.tsx @@ -31,7 +31,7 @@ import { deleteAnswer, editCheck, reopenQuestion, - questionOpetation, + questionOperation, unDeleteAnswer, unDeleteQuestion, } from '@/services'; @@ -219,7 +219,7 @@ const Index: FC = ({ }; const handleCommon = async (params) => { - await questionOpetation(params); + await questionOperation(params); let msg = ''; if (params.operation === 'pin') { msg = t('post_pin', { keyPrefix: 'messages' }); diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsx index 8b787314..49f462f5 100644 --- a/ui/src/pages/Questions/Ask/index.tsx +++ b/ui/src/pages/Questions/Ask/index.tsx @@ -37,7 +37,7 @@ import { useQueryRevisions, useQueryQuestionByTitle, getTagsBySlugName, - saveQuestionWidthAnaser, + saveQuestionWithAnswer, } from '@/services'; import { handleFormError, SaveDraft, storageExpires } from '@/utils'; import { pathFactory } from '@/router/pathFactory'; @@ -310,7 +310,7 @@ const Ask = () => { } let res; if (checked) { - res = await saveQuestionWidthAnaser({ + res = await saveQuestionWithAnswer({ ...params, answer_content: formData.answer_content.value, }).catch((err) => { diff --git a/ui/src/services/common.ts b/ui/src/services/common.ts index f6fbf613..f4efca73 100644 --- a/ui/src/services/common.ts +++ b/ui/src/services/common.ts @@ -301,11 +301,11 @@ export const markdownToHtml = (content: string) => { return request.post(apiUrl, { content }); }; -export const saveQuestionWidthAnaser = (params: Type.QuestionWithAnswer) => { +export const saveQuestionWithAnswer = (params: Type.QuestionWithAnswer) => { return request.post('/answer/api/v1/question/answer', params); }; -export const questionOpetation = (params: Type.QuestionOperationReq) => { +export const questionOperation = (params: Type.QuestionOperationReq) => { return request.put('/answer/api/v1/question/operation', params); };