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
+4 -2
View File
@@ -4,9 +4,11 @@ import { ApiResponse } from "../types";
import { TCms, TCmsListResponse } from "../types/TCms";
export const cmsService = {
getCms: async (): Promise<ApiResponse<TCmsListResponse>> => {
getCms: async (
params?: Record<string, any>,
): Promise<ApiResponse<TCmsListResponse>> => {
try {
return (await api.get(API_ENDPOINTS.CMS.BASE())).data;
return (await api.get(API_ENDPOINTS.CMS.BASE(), { params })).data;
} catch (error) {
console.error("Error Caught in CMS Service => Get cms", error);
throw error;