fix image on tab to run, and add delete for automation and scene

This commit is contained in:
ashrafzarkanisala
2024-11-28 10:43:35 +03:00
parent 1c54011ed4
commit 57dec8af08
6 changed files with 302 additions and 146 deletions

View File

@ -212,38 +212,39 @@ class SceneApi {
// }
// }
//
// //delete Scene
//
// static Future<bool> deleteScene(
// {required String unitUuid, required String sceneId}) async {
// try {
// final response = await _httpService.delete(
// path: ApiEndpoints.deleteScene
// .replaceAll('{sceneId}', sceneId)
// .replaceAll('{unitUuid}', unitUuid),
// showServerMessage: false,
// expectedResponseModel: (json) => json['statusCode'] == 200,
// );
// return response;
// } catch (e) {
// 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;
// }
// }
//delete Scene
static Future<bool> deleteScene(
{required String unitUuid, required String sceneId}) async {
try {
final response = await _httpService.delete(
path: ApiEndpoints.deleteScene
.replaceAll('{sceneId}', sceneId)
.replaceAll('{unitUuid}', unitUuid),
showServerMessage: false,
expectedResponseModel: (json) => json['statusCode'] == 200,
);
return response;
} catch (e) {
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;
}
}
}