Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
f7d0725edb
commit
518291f518
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user