feat: Introduce dynamic profile filtering with a new service and update user and agent profiles to use separate first and last name fields.

This commit is contained in:
pradeepkumar
2026-02-01 15:04:51 +05:30
parent 35ae58c0df
commit 09cf44f418
5 changed files with 167 additions and 333 deletions

View File

@@ -97,6 +97,14 @@ interface ApiResponse<T> {
message?: string;
}
// Filterable field structure from backend
export interface FilterableField {
slug: string;
name: string;
fieldType: string;
options: FieldOption[];
}
// Profile Sections Service for Web
class ProfileSectionsService {
private basePath = '/profile-sections';
@@ -116,6 +124,14 @@ class ProfileSectionsService {
const response = await api.get<ApiResponse<ProfileSection[]>>(url);
return response.data.data;
}
/**
* Get all filterable fields with options (for search filters)
*/
async getFilterableFields(): Promise<FilterableField[]> {
const response = await api.get<ApiResponse<FilterableField[]>>('/profile-fields/filterable');
return response.data.data;
}
}
export const profileSectionsService = new ProfileSectionsService();