Merge branch 'dev' into SP-1737-FE-The-user-appears-as-Null-and-the-project-uuid-is-null-when-we-login-in-after-a-credentials-error

This commit is contained in:
Faris Armoush
2025-06-17 14:26:28 +03:00
committed by GitHub
7 changed files with 59 additions and 56 deletions

View File

@ -34,9 +34,8 @@ class UserPermissionApi {
path: ApiEndpoints.roleTypes,
showServerMessage: true,
expectedResponseModel: (json) {
final List<RoleTypeModel> fetchedRoles = (json['data'] as List)
.map((item) => RoleTypeModel.fromJson(item))
.toList();
final List<RoleTypeModel> fetchedRoles =
(json['data'] as List).map((item) => RoleTypeModel.fromJson(item)).toList();
return fetchedRoles;
},
);
@ -48,9 +47,7 @@ class UserPermissionApi {
path: ApiEndpoints.permission.replaceAll("roleUuid", roleUuid),
showServerMessage: true,
expectedResponseModel: (json) {
return (json as List)
.map((data) => PermissionOption.fromJson(data))
.toList();
return (json as List).map((data) => PermissionOption.fromJson(data)).toList();
},
);
return response ?? [];
@ -195,14 +192,10 @@ class UserPermissionApi {
Future<bool> changeUserStatusById(userUuid, status, String projectUuid) async {
try {
Map<String, dynamic> bodya = {
"disable": status,
"projectUuid": projectUuid
};
Map<String, dynamic> bodya = {"disable": status, "projectUuid": projectUuid};
final response = await _httpService.put(
path: ApiEndpoints.changeUserStatus
.replaceAll("{invitedUserUuid}", userUuid),
path: ApiEndpoints.changeUserStatus.replaceAll("{invitedUserUuid}", userUuid),
body: bodya,
expectedResponseModel: (json) {
return json['success'];