Feat: add filter in chat and search page (#16707)

This commit is contained in:
chanx
2026-07-08 16:47:01 +08:00
committed by GitHub
parent 5baf4089bf
commit b9432bb43f
4 changed files with 41 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
import { FileUploadProps } from '@/components/file-upload';
import { useHandleFilterSubmit } from '@/components/list-filter-bar/use-handle-filter-submit';
import message from '@/components/ui/message';
import { ChatSearchParams } from '@/constants/chat';
import {
@@ -65,6 +66,7 @@ export const useFetchChatList = () => {
const { searchString, handleInputChange } = useHandleSearchChange();
const { pagination, setPagination } = useGetPaginationWithRouter();
const debouncedSearchString = useDebounce(searchString, { wait: 500 });
const { filterValue, handleFilterSubmit } = useHandleFilterSubmit();
const {
data,
@@ -75,6 +77,7 @@ export const useFetchChatList = () => {
ChatApiAction.FetchChatList,
{
debouncedSearchString,
filterValue,
...pagination,
},
],
@@ -88,8 +91,10 @@ export const useFetchChatList = () => {
keywords: debouncedSearchString,
page_size: pagination.pageSize,
page: pagination.current,
owner_ids: filterValue.owner,
},
data: {},
paramsSerializer: { indexes: null },
},
true,
);
@@ -113,6 +118,8 @@ export const useFetchChatList = () => {
handleInputChange: onInputChange,
pagination: { ...pagination, total: data?.total },
setPagination,
filterValue,
handleFilterSubmit,
};
};