Skip to content

Commit

Permalink
Fix error on type of user organisations in user entity
Browse files Browse the repository at this point in the history
  • Loading branch information
BaharaJr committed Sep 4, 2024
1 parent d253269 commit 0270da1
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 90 deletions.
4 changes: 3 additions & 1 deletion lib/modules/auth/entities/user.entity.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ class User extends IdentifiableEntity {
lastUpdated: jsonData['lastUpdated'],
teiSearchOrganisationUnits:
jsonData['teiSearchOrganisationUnits'].toString(),
organisationUnits: jsonData['organisationUnits'],
organisationUnits: (jsonData['organisationUnits'] ?? [])
.map((ou) => UserOrganisationUnit.fromJson(ou))
.toList(),
authorities: (jsonData['authorities'] ?? [])
.map<UserAuthority>((authority) => UserAuthority(
id: authority['id'],
Expand Down
2 changes: 1 addition & 1 deletion lib/shared/utilities/http_client.util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class HttpClient {
}));

final response = await dioClient.delete(
'${httpDetails.baseUrl}/api/${resourceUrl!.split('.').first}/$id');\
'${httpDetails.baseUrl}/api/${resourceUrl!.split('.').first}/$id');

return HttpResponse(
statusCode: response.statusCode ?? 500, body: response.data);
Expand Down
Loading

0 comments on commit 0270da1

Please sign in to comment.