feat: add public share options for workflow

This commit is contained in:
BennyKok
2024-01-14 23:35:25 +08:00
parent dafc8b168b
commit 18cfbce171
22 changed files with 1327 additions and 158 deletions
+9
View File
@@ -5,7 +5,9 @@ import { db } from "@/db/db";
import type { MachineType, WorkflowVersionType } from "@/db/schema";
import { machinesTable, workflowRunsTable } from "@/db/schema";
import type { APIKeyUserType } from "@/server/APIKeyBodyRequest";
import { getRunsData } from "@/server/getRunsData";
import { ComfyAPI_Run } from "@/types/ComfyAPI_Run";
import { auth } from "@clerk/nextjs";
import { and, eq } from "drizzle-orm";
import { revalidatePath } from "next/cache";
import "server-only";
@@ -219,3 +221,10 @@ export const createRun = withServerPromise(
};
}
);
export async function checkStatus(run_id: string) {
const { userId } = auth();
if (!userId) throw new Error("User not found");
return await getRunsData(run_id);
}