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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user