mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2026-10-24 23:47:56 +00:00
connect delete api
This commit is contained in:
@@ -140,7 +140,7 @@ abstract class ApiEndpoints {
|
||||
|
||||
/// DELETE
|
||||
static const String deleteScene =
|
||||
'$baseUrl/scene/tap-to-run/{sceneUuid}/{sceneId}';
|
||||
'$baseUrl/scene/tap-to-run/{unitUuid}/{sceneId}';
|
||||
|
||||
//////////////////////Door Lock //////////////////////
|
||||
//online
|
||||
|
||||
@@ -76,7 +76,8 @@ class SceneApi {
|
||||
try {
|
||||
final response = await _httpService.put(
|
||||
path: ApiEndpoints.updateScene.replaceAll('{sceneId}', sceneId),
|
||||
body: createSceneModel.toJson(sceneId),
|
||||
body: createSceneModel
|
||||
.toJson(sceneId.isNotEmpty == true ? sceneId : null),
|
||||
expectedResponseModel: (json) {
|
||||
return json;
|
||||
},
|
||||
@@ -88,4 +89,20 @@ class SceneApi {
|
||||
}
|
||||
|
||||
//deleteScene
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user