mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
refactor schedule view and cleaning
This commit is contained in:
@ -195,6 +195,29 @@ class DevicesManagementApi {
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<ScheduleModel>> getDeviceSchedules(
|
||||
String uuid, String category) async {
|
||||
try {
|
||||
final response = await HTTPService().get(
|
||||
path: ApiEndpoints.scheduleByDeviceId
|
||||
.replaceAll('{deviceUuid}', uuid)
|
||||
.replaceAll('{category}', category),
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
List<ScheduleModel> schedules = [];
|
||||
for (var schedule in json['schedules']) {
|
||||
schedules.add(ScheduleModel.fromJson(schedule));
|
||||
}
|
||||
return schedules;
|
||||
},
|
||||
);
|
||||
return response;
|
||||
} catch (e) {
|
||||
debugPrint('Error fetching $e');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> updateScheduleRecord(
|
||||
{required bool enable,
|
||||
required String uuid,
|
||||
|
Reference in New Issue
Block a user