mirror of https://gitee.com/answerdev/answer.git
fix: #27 Fixed tag question list parameter
This commit is contained in:
parent
a7fc3923fb
commit
d985024877
|
@ -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';
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue