push remove try catch

This commit is contained in:
ashrafzarkanisala
2024-08-04 18:31:49 +03:00
parent a65c602725
commit 305680a082

View File

@ -13,18 +13,16 @@ class HomeManagementAPI {
var userId = await storage.read(key: UserModel.userUuidKey) ?? '';
List<DeviceModel> list = [];
try {
await _httpService.get(
path: ApiEndpoints.getDevicesByUserId.replaceAll("{userId}", userId),
showServerMessage: false,
expectedResponseModel: (json) {
json.forEach((value) {
list.add(DeviceModel.fromJson(value));
});
await _httpService.get(
path: ApiEndpoints.getDevicesByUserId.replaceAll("{userId}", userId),
showServerMessage: false,
expectedResponseModel: (json) {
json.forEach((value) {
list.add(DeviceModel.fromJson(value));
});
} catch (e) {
rethrow;
}
});
return list;
}