mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-14 17:25:47 +00:00
temp
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import 'package:syncrow_app/features/devices/model/device_category_model.dart';
|
||||
import 'package:syncrow_app/features/devices/model/device_control_model.dart';
|
||||
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
|
||||
import 'package:syncrow_app/services/api/http_service.dart';
|
||||
@ -15,4 +16,20 @@ class DevicesAPI {
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
static Future<List<DevicesCategoryModel>> fetchGroups(int spaceId) async {
|
||||
final response = await HTTPService().get(
|
||||
path: ApiEndpoints.control,
|
||||
queryParameters: {'homeId': spaceId, 'pageSize': 100, 'page': 1},
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
List<DevicesCategoryModel> categories = [];
|
||||
for (var category in json['groups']) {
|
||||
categories.add(DevicesCategoryModel.fromJson(category));
|
||||
}
|
||||
},
|
||||
);
|
||||
print('fetchGroups response: $response');
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user