// (C) 2024-2026 GoodData Corporation
import { call } from "redux-saga/effects";
import { alertCreated } from "../../events/alerts.js";
function createAlert(ctx, alert) {
    const { backend, workspace } = ctx;
    return backend.workspace(workspace).automations().createAutomation(alert);
}
export function* createAlertHandler(ctx, cmd) {
    const alert = yield call(createAlert, ctx, cmd.payload.alert);
    return alertCreated(ctx, alert, cmd.correlationId);
}
