updated endpoint for creating automations

This commit is contained in:
hannathkadher
2025-03-14 11:54:47 +04:00
parent 2a0f6a4596
commit 7ae3e4a933
3 changed files with 7 additions and 5 deletions

View File

@ -324,6 +324,8 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
Future<void> _onCreateAutomation(CreateAutomationEvent event, Emitter<RoutineState> emit) async {
try {
final projectUuid = await ProjectManager.getProjectUUID() ?? '';
if (state.routineName == null || state.routineName!.isEmpty) {
emit(state.copyWith(
errorMessage: 'Automation name is required',
@ -434,7 +436,7 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
actions: actions,
);
final result = await SceneApi.createAutomation(createAutomationModel);
final result = await SceneApi.createAutomation(createAutomationModel, projectUuid);
if (result['success']) {
add(ResetRoutineState());
add(const LoadAutomation());