Merge branch 'fix-27' into 'main'

fix: #27 Fixed tag question list parameter

See merge request opensource/answer!115
This commit is contained in:
Li Shuailing 2022-10-27 03:01:43 +00:00
commit 0f70354f50
2 changed files with 3 additions and 3 deletions

View File

@ -218,7 +218,7 @@ export type QuestionOrderBy =
export interface QueryQuestionsReq extends Paging {
order: QuestionOrderBy;
tags?: string[];
tag?: string;
}
export type AdminQuestionStatus = 'available' | 'closed' | 'deleted';

View File

@ -92,11 +92,11 @@ const QuestionList: FC<Props> = ({ source }) => {
page_size: pageSize,
page: curPage,
order: curOrder as Type.QuestionOrderBy,
tags: [tagName],
tag: tagName,
};
if (source === 'questions') {
delete reqParams.tags;
delete reqParams.tag;
}
const { data: listData, isLoading } = useQuestionList(reqParams);
const count = listData?.count || 0;