updated delete automation endpoint

This commit is contained in:
hannathkadher
2025-03-14 12:12:15 +04:00
parent 2a065efc0e
commit bc64efa557
3 changed files with 6 additions and 4 deletions

View File

@ -798,6 +798,8 @@ class RoutineBloc extends Bloc<RoutineEvent, RoutineState> {
FutureOr<void> _deleteScene(DeleteScene event, Emitter<RoutineState> emit) async {
try {
final projectId = await ProjectManager.getProjectUUID() ?? '';
emit(state.copyWith(isLoading: true));
BuildContext context = NavigationService.navigatorKey.currentContext!;
var spaceBloc = context.read<SpaceTreeBloc>();
@ -806,7 +808,7 @@ 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 ?? '');
unitUuid: spaceBloc.state.selectedSpaces[0], automationId: state.automationId ?? '',projectId: projectId);
}
add(const LoadScenes());