mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 10:16:43 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
7c541f3459
commit
376b1e5c36
1 changed files with 6 additions and 7 deletions
|
|
@ -68,14 +68,13 @@ export function CronjobCard({ job }: Props) {
|
||||||
|
|
||||||
async function remove() {
|
async function remove() {
|
||||||
try {
|
try {
|
||||||
await deleteMut.mutateAsync(job.id);
|
const result = await deleteMut.mutateAsync(job.id);
|
||||||
toast.success("Automação excluída.");
|
if (result.runtime_sync_warning) {
|
||||||
setConfirmDelete(false);
|
toast.warning("Automação removida do painel; limpeza final do runtime pendente.");
|
||||||
|
} else {
|
||||||
const { error: syncError } = await syncAgentRuntime(job.agent_instance_id, "cronjobs");
|
toast.success("Automação excluída.");
|
||||||
if (syncError) {
|
|
||||||
toast.warning("Automação removida, mas o runtime do agente não sincronizou.");
|
|
||||||
}
|
}
|
||||||
|
setConfirmDelete(false);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
toast.error(e instanceof Error ? e.message : "Erro ao excluir.");
|
toast.error(e instanceof Error ? e.message : "Erro ao excluir.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue