feat: scope filterable fields to agent type and update active filters on selection change
This commit is contained in:
@@ -89,10 +89,16 @@ class AgentsRepository {
|
||||
}
|
||||
|
||||
/// Get filterable profile fields: GET /profile-fields/filterable
|
||||
/// When `agentTypeId` is provided, backend scopes filters to that agent type + globals.
|
||||
/// Response: { success, data: [...] }
|
||||
Future<List<FilterableField>> getFilterableFields() async {
|
||||
Future<List<FilterableField>> getFilterableFields({String? agentTypeId}) async {
|
||||
try {
|
||||
final response = await _dio.get(ApiConstants.filterableFields);
|
||||
final response = await _dio.get(
|
||||
ApiConstants.filterableFields,
|
||||
queryParameters: agentTypeId != null && agentTypeId.isNotEmpty
|
||||
? {'agentTypeId': agentTypeId}
|
||||
: null,
|
||||
);
|
||||
final data = response.data['data'] as List<dynamic>;
|
||||
return data
|
||||
.map((e) => FilterableField.fromJson(e as Map<String, dynamic>))
|
||||
|
||||
Reference in New Issue
Block a user