Fix bugs related to the user table, privacy policy, and table filter.

This commit is contained in:
mohammad
2025-01-30 16:43:45 +03:00
parent e70b9ea9e2
commit b070884bd9
17 changed files with 454 additions and 321 deletions

View File

@ -18,8 +18,7 @@ class UserPermissionApi {
showServerMessage: true,
expectedResponseModel: (json) {
debugPrint('fetchUsers Response: $json');
final List<dynamic> data =
json['data'] ?? []; // Default to an empty list if no data
final List<dynamic> data = json['data'] ?? [];
return data.map((item) => RolesUserModel.fromJson(item)).toList();
},
);
@ -119,7 +118,7 @@ class UserPermissionApi {
);
return response ?? 'Unknown error occurred';
} on DioException catch (e) {
final errorMessage = e.response?.data['error'];
final errorMessage = e.response?.data['error']['message'];
return errorMessage;
} catch (e) {
return e.toString();
@ -205,7 +204,6 @@ class UserPermissionApi {
.replaceAll("{invitedUserUuid}", userUuid),
body: bodya,
expectedResponseModel: (json) {
print('changeUserStatusById==${json['success']}');
return json['success'];
},
);
@ -213,7 +211,6 @@ class UserPermissionApi {
return response;
} catch (e) {
return false;
print(e);
}
}
}