mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Revert "Sp 1589 fe when user navigates to devices page the devices are already listed although no community is selected also when we select a community the api is being called repeatedly too many times (#305)"
This reverts commit034a5ef908
, reversing changes made tob97183fb61
.
This commit is contained in:
@ -13,13 +13,15 @@ import 'package:syncrow_web/utils/constants/api_const.dart';
|
||||
|
||||
class DevicesManagementApi {
|
||||
Future<List<AllDevicesModel>> fetchDevices(
|
||||
String projectId, {
|
||||
List<String>? spacesId,
|
||||
}) async {
|
||||
String communityId, String spaceId, String projectId) async {
|
||||
try {
|
||||
final response = await HTTPService().get(
|
||||
queryParameters: {if (spacesId != null) 'spaces': spacesId},
|
||||
path: ApiEndpoints.getAllDevices.replaceAll('{projectId}', projectId),
|
||||
path: communityId.isNotEmpty && spaceId.isNotEmpty
|
||||
? ApiEndpoints.getSpaceDevices
|
||||
.replaceAll('{spaceUuid}', spaceId)
|
||||
.replaceAll('{communityUuid}', communityId)
|
||||
.replaceAll('{projectId}', projectId)
|
||||
: ApiEndpoints.getAllDevices.replaceAll('{projectId}', projectId),
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
List<dynamic> jsonData = json['data'];
|
||||
@ -414,4 +416,5 @@ class DevicesManagementApi {
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user