mirror of
https://github.com/domfelipe/mika-agent-assist.git
synced 2026-08-07 06:16:42 +00:00
Changes
Co-authored-by: domfelipe <53182096+domfelipe@users.noreply.github.com>
This commit is contained in:
parent
9d0e839508
commit
7c541f3459
1 changed files with 11 additions and 2 deletions
|
|
@ -181,8 +181,17 @@ export function useDeleteCronjob() {
|
|||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: async (id: string) => {
|
||||
const { error } = await supabase.from("scheduled_jobs").delete().eq("id", id);
|
||||
if (error) throw error;
|
||||
const { data, error } = await invokeFunction<{
|
||||
success: boolean;
|
||||
job_id: string;
|
||||
agent_instance_id: string;
|
||||
archived: boolean;
|
||||
deleted: boolean;
|
||||
runtime_sync_warning: string | null;
|
||||
}>("delete-cronjob", { job_id: id });
|
||||
if (error) throw new Error(error.message);
|
||||
if (!data?.success) throw new Error("Erro ao excluir automação.");
|
||||
return data;
|
||||
},
|
||||
onSuccess: () => {
|
||||
qc.invalidateQueries({ queryKey: ["cronjobs"] });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue