import { Workflow, WorkflowNode } from "@/domain/workflow"; import { getPb } from "./api"; export const get = async (id: string) => { const response = await getPb().collection("workflow").getOne(id); return response; }; export const save = async (data: Record) => { if (data.id) { return await getPb() .collection("workflow") .update(data.id as string, data); } return await getPb().collection("workflow").create(data); };