mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-25 16:47:56 +00:00
push delete automation
This commit is contained in:
@@ -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 =
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user