fetchDevices by projectUuid

This commit is contained in:
mohammad
2025-02-20 16:02:25 +03:00
parent 0b45d61b25
commit 8393ec353a
4 changed files with 34 additions and 8 deletions
@@ -51,7 +51,8 @@ class ManageUnitBloc extends Bloc<ManageUnitEvent, ManageUnitState> {
spaceUuid: event.unit.id,
roomId: event.roomId,
projectId: project?.uuid ?? TempConst.projectIdDev);
allDevices = await HomeManagementAPI.fetchDevicesByUserId();
allDevices = await HomeManagementAPI.fetchDevices(
project?.uuid ?? TempConst.projectIdDev);
List<String> allDevicesIds = [];
@@ -28,8 +28,7 @@ class AssignDeviceView extends StatelessWidget {
listener: (context, state) {
if (state is FetchDeviceByRoomIdState) {
if (state.allDevices.isEmpty) {
CustomSnackBar.displaySnackBar(
'You do not have the permission to assign devices');
CustomSnackBar.displaySnackBar('You do not have the devices');
Navigator.of(context).pop();
}
}