push autoamtion api connect

This commit is contained in:
ashrafzarkanisala
2024-07-24 01:41:10 +03:00
parent 9a088353e0
commit 7a773f1653
20 changed files with 874 additions and 272 deletions

View File

@ -1,3 +1,4 @@
import 'package:syncrow_app/features/scene/model/create_automation_model.dart';
import 'package:syncrow_app/features/scene/model/create_scene_model.dart';
import 'package:syncrow_app/features/scene/model/scene_details_model.dart';
import 'package:syncrow_app/features/scene/model/scenes_model.dart';
@ -24,6 +25,23 @@ class SceneApi {
}
}
static Future<Map<String, dynamic>> createAutomation(
CreateAutomationModel createAutomationModel) async {
try {
final response = await _httpService.post(
path: ApiEndpoints.createAutomation,
body: createAutomationModel.toMap(),
showServerMessage: false,
expectedResponseModel: (json) {
return json;
},
);
return response;
} catch (e) {
rethrow;
}
}
static Future<List<ScenesModel>> getScenesByUnitId(String unitId) async {
try {
final response = await _httpService.get(