mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
changed endpoint for automation update
This commit is contained in:
@ -808,7 +808,9 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
|
||||
unitUuid: spaceBloc.state.selectedSpaces[0], sceneId: state.sceneId ?? '');
|
||||
} else {
|
||||
await SceneApi.deleteAutomation(
|
||||
unitUuid: spaceBloc.state.selectedSpaces[0], automationId: state.automationId ?? '',projectId: projectId);
|
||||
unitUuid: spaceBloc.state.selectedSpaces[0],
|
||||
automationId: state.automationId ?? '',
|
||||
projectId: projectId);
|
||||
}
|
||||
|
||||
add(const LoadScenes());
|
||||
@ -948,6 +950,8 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
|
||||
|
||||
FutureOr<void> _onUpdateAutomation(UpdateAutomation event, Emitter<RoutineState> emit) async {
|
||||
try {
|
||||
final projectId = await ProjectManager.getProjectUUID() ?? '';
|
||||
|
||||
if (state.routineName == null || state.routineName!.isEmpty) {
|
||||
emit(state.copyWith(
|
||||
errorMessage: 'Automation name is required',
|
||||
@ -1057,8 +1061,8 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
|
||||
actions: actions,
|
||||
);
|
||||
|
||||
final result =
|
||||
await SceneApi.updateAutomation(createAutomationModel, state.automationId ?? '');
|
||||
final result = await SceneApi.updateAutomation(
|
||||
createAutomationModel, state.automationId ?? '', projectId);
|
||||
|
||||
if (result['success']) {
|
||||
add(ResetRoutineState());
|
||||
|
Reference in New Issue
Block a user