push delete automation

This commit is contained in:
ashrafzarkanisala
2024-07-25 00:34:00 +03:00
parent 8a4c5af2e7
commit 3e20ba8f42
6 changed files with 46 additions and 8 deletions
+6 -3
View File
@@ -144,18 +144,21 @@ abstract class ApiEndpoints {
static const String getUnitAutomation = '$baseUrl/automation/{unitUuid}';
static const String getAutomationDetails = '$baseUrl/automation/details/{automationId}';
static const String getAutomationDetails =
'$baseUrl/automation/details/{automationId}';
/// PUT
static const String updateScene = '$baseUrl/scene/tap-to-run/{sceneId}';
static const String updateAutomation =
'$baseUrl/automation/{automationId}';
static const String updateAutomation = '$baseUrl/automation/{automationId}';
/// DELETE
static const String deleteScene =
'$baseUrl/scene/tap-to-run/{unitUuid}/{sceneId}';
static const String deleteAutomation =
'$baseUrl/automation/{unitUuid}/{automationId}';
//////////////////////Door Lock //////////////////////
//online
static const String addTemporaryPassword =
+17
View File
@@ -183,4 +183,21 @@ class SceneApi {
rethrow;
}
}
// delete automation
static Future<bool> deleteAutomation(
{required String unitUuid, required String automationId}) async {
try {
final response = await _httpService.delete(
path: ApiEndpoints.deleteAutomation
.replaceAll('{automationId}', automationId)
.replaceAll('{unitUuid}', unitUuid),
showServerMessage: false,
expectedResponseModel: (json) => json['statusCode'] == 200,
);
return response;
} catch (e) {
rethrow;
}
}
}