Refactor device management and space management APIs, update event and state classes, and add RemoveDeviceWidget for device removal functionality.

This commit is contained in:
mohammad
2025-06-03 16:34:00 +03:00
parent cabd37a08a
commit 906c2d0430
10 changed files with 549 additions and 479 deletions

View File

@ -370,7 +370,8 @@ class DevicesManagementApi {
});
return response;
}
static Future resetDevise({
static Future resetDevice({
String? devicesUuid,
}) async {
final response = await HTTPService().post(
@ -385,7 +386,4 @@ class DevicesManagementApi {
);
return response;
}
}

View File

@ -373,7 +373,6 @@ class CommunitySpaceManagementApi {
required String spaceId,
required String projectId}) async {
try {
// Construct the API path
final path = ApiEndpoints.listSubspace
.replaceFirst('{communityUuid}', communityId)
.replaceFirst('{spaceUuid}', spaceId)
@ -389,9 +388,6 @@ class CommunitySpaceManagementApi {
for (var subspace in json['data']) {
rooms.add(SubSpaceModel.fromJson(subspace));
}
} else {
debugPrint(
"Warning: 'data' key is missing or null in response JSON.");
}
return rooms;
},
@ -399,7 +395,7 @@ class CommunitySpaceManagementApi {
return response;
} catch (error, stackTrace) {
return []; // Return an empty list if there's an error
return [];
}
}