feat(cms): Add filtering functionality to CMS list table

- Create CmsListFilters component with search and key filter fields
- Add filter modal to CMS table with open/close functionality
- Implement useForm hook integration for filter form management
- Update useCmsTablePresenter to handle filter state and search logic
- Modify useGetCmsList query hook to accept and pass filter parameters
- Update cms-service.getCms method to support query parameters
- Add URL-based query string management for filter persistence
- Integrate filter button in ListHeader component
- Add isMutating state tracking for loading indicator during search
This commit is contained in:
AmirReza Jamali
2025-11-23 10:51:55 +03:30
parent e13527fe81
commit 410ca5a737
5 changed files with 150 additions and 9 deletions
+3 -3
View File
@@ -5,11 +5,11 @@ import { useRouter } from "next/navigation";
import { useMemo } from "react";
import { toast } from "react-toastify";
export const useGetCmsList = () => {
const queryKey = useMemo(() => [API_ENDPOINTS.CMS.BASE()], []);
export const useGetCmsList = (params?: Record<string, any>) => {
const queryKey = useMemo(() => [API_ENDPOINTS.CMS.BASE(), params], [params]);
return useQuery({
queryKey,
queryFn: cmsService.getCms,
queryFn: () => cmsService.getCms(params),
});
};
export const useGetCmsDetails = (id: string) => {