mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 07:42:28 +00:00
fix communities filtiring issue
This commit is contained in:
@ -13,11 +13,15 @@ import 'package:syncrow_web/utils/constants/api_const.dart';
|
||||
|
||||
class DevicesManagementApi {
|
||||
Future<List<AllDevicesModel>> fetchDevices(String projectId,
|
||||
{List<String>? spacesId}) async {
|
||||
{List<String>? spacesId, List<String>? communities}) async {
|
||||
try {
|
||||
final response = await HTTPService().get(
|
||||
path: ApiEndpoints.getSpaceDevices.replaceAll('{projectId}', projectId),
|
||||
queryParameters: {if (spacesId != null) 'spaces': spacesId},
|
||||
queryParameters: {
|
||||
if (spacesId != null && spacesId.isNotEmpty) 'spaces': spacesId,
|
||||
if (communities != null && communities.isNotEmpty)
|
||||
'communities': communities,
|
||||
},
|
||||
showServerMessage: true,
|
||||
expectedResponseModel: (json) {
|
||||
final List<dynamic> jsonData = json['data'] as List<dynamic>;
|
||||
|
Reference in New Issue
Block a user