fix: #27 Fixed tag question list parameter

This commit is contained in:
shuai 2022-10-27 10:50:10 +08:00
parent a7fc3923fb
commit d985024877
2 changed files with 3 additions and 3 deletions

View File

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

View File

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