changed endpoint for getting automations by space

This commit is contained in:
hannathkadher
2025-03-14 12:53:29 +04:00
parent c2fc8fa0ae
commit 0673548745
8 changed files with 77 additions and 36 deletions

View File

@ -153,7 +153,7 @@ abstract class ApiEndpoints {
static const String getScene = '/scene/tap-to-run/{sceneId}';
static const String getIconScene = '/scene/icon';
static const String getUnitAutomation = '/automation/{unitUuid}';
static const String getUnitAutomation = '/projects/{projectId}/communities/{communityId}/spaces/{unitUuid}/automations';
static const String getAutomationDetails =
'/automation/details/{automationId}';

View File

@ -78,10 +78,17 @@ class SceneApi {
//getAutomation
static Future<List<ScenesModel>> getAutomationByUnitId(String unitId) async {
static Future<List<ScenesModel>> getAutomationByUnitId(
String unitId,
String communityId,
String projectId,
) async {
try {
final response = await _httpService.get(
path: ApiEndpoints.getUnitAutomation.replaceAll('{unitUuid}', unitId),
path: ApiEndpoints.getUnitAutomation
.replaceAll('{unitUuid}', unitId)
.replaceAll('{communityId}', communityId)
.replaceAll('{projectId}', projectId),
showServerMessage: false,
expectedResponseModel: (json) {
List<ScenesModel> scenes = [];