Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 23:45:17 +00:00
co-authored by renee-png
parent f7d0725edb
commit 518291f518
+11 -2
View File
@@ -61,6 +61,8 @@ import {
Tag,
} from "lucide-react";
import { toast } from "sonner";
import { spawnNextCollectionWorkflowTask } from "@/lib/workflow-chain";
import { ApplyCollectionWorkflowDialog } from "@/components/collections/apply-collection-workflow-dialog";
export const Route = createFileRoute("/collections/$collectionId")({
component: CollectionDetailRoute,
@@ -224,8 +226,15 @@ function CollectionDetailRoute() {
done_at: next ? new Date().toISOString() : null,
})
.eq("id", t.id);
if (error) toast.error("Could not update", { description: error.message });
else refreshTasks();
if (error) {
toast.error("Could not update", { description: error.message });
return;
}
if (next) {
// Auto-spawn the next workflow task in the chain (if any)
await spawnNextCollectionWorkflowTask(t.id);
}
refreshTasks();
};
const deleteTask = async (id: string) => {