mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
changed endpoint for create automation endpoint
This commit is contained in:
@ -144,7 +144,7 @@ abstract class ApiEndpoints {
|
||||
/// POST
|
||||
static const String createScene = '/scene/tap-to-run';
|
||||
static const String triggerScene = '/scene/tap-to-run/{sceneId}/trigger';
|
||||
static const String createAutomation = '/automation';
|
||||
static const String createAutomation = '/projects/{projectId}/automations';
|
||||
|
||||
/// GET
|
||||
static const String getUnitScenes =
|
||||
|
@ -6,7 +6,6 @@ import 'package:syncrow_app/features/scene/model/scenes_model.dart';
|
||||
import 'package:syncrow_app/features/scene/model/update_automation.dart';
|
||||
import 'package:syncrow_app/services/api/api_links_endpoints.dart';
|
||||
import 'package:syncrow_app/services/api/http_service.dart';
|
||||
import 'package:syncrow_app/utils/constants/temp_const.dart';
|
||||
|
||||
class SceneApi {
|
||||
static final HTTPService _httpService = HTTPService();
|
||||
@ -31,10 +30,11 @@ class SceneApi {
|
||||
|
||||
// create automation
|
||||
static Future<Map<String, dynamic>> createAutomation(
|
||||
CreateAutomationModel createAutomationModel) async {
|
||||
CreateAutomationModel createAutomationModel, String projectId) async {
|
||||
try {
|
||||
final response = await _httpService.post(
|
||||
path: ApiEndpoints.createAutomation,
|
||||
path:
|
||||
ApiEndpoints.createAutomation.replaceAll('{projectId}', projectId),
|
||||
body: createAutomationModel.toMap(),
|
||||
showServerMessage: false,
|
||||
expectedResponseModel: (json) {
|
||||
|
Reference in New Issue
Block a user