fix format

This commit is contained in:
BennyKok 2023-12-10 12:40:17 +08:00
parent 457698695c
commit e65dff9b72
2 changed files with 7 additions and 12 deletions

View File

@ -11,7 +11,7 @@ import { db } from "@/db/db";
import { workflowTable, workflowVersionTable } from "@/db/schema"; import { workflowTable, workflowVersionTable } from "@/db/schema";
import { getRelativeTime } from "@/lib/getRelativeTime"; import { getRelativeTime } from "@/lib/getRelativeTime";
import { getMachines } from "@/server/curdMachine"; import { getMachines } from "@/server/curdMachine";
import { desc, eq, sql } from "drizzle-orm"; import { desc, eq } from "drizzle-orm";
import { Play } from "lucide-react"; import { Play } from "lucide-react";
export async function findFirstTableWithVersion(workflow_id: string) { export async function findFirstTableWithVersion(workflow_id: string) {
@ -57,7 +57,7 @@ export default async function Page({
<CardTitle>Run</CardTitle> <CardTitle>Run</CardTitle>
</CardHeader> </CardHeader>
<CardContent></CardContent> <CardContent />
</Card> </Card>
</div> </div>
); );

View File

@ -1,14 +1,9 @@
import { parseDataSafe } from "../../../lib/parseDataSafe"; import { parseDataSafe } from "../../../lib/parseDataSafe";
import { db } from "@/db/db"; import { db } from "@/db/db";
import { import { workflowRunsTable } from "@/db/schema";
workflowRunStatus, import { eq } from "drizzle-orm";
workflowRunsTable,
workflowTable,
workflowVersionTable,
} from "@/db/schema";
import { eq, sql } from "drizzle-orm";
import { NextResponse } from "next/server"; import { NextResponse } from "next/server";
import { ZodFormattedError, z } from "zod"; import { z } from "zod";
const Request = z.object({ const Request = z.object({
run_id: z.string(), run_id: z.string(),
@ -30,7 +25,7 @@ export async function POST(request: Request) {
const [data, error] = await parseDataSafe(Request, request); const [data, error] = await parseDataSafe(Request, request);
if (!data || error) return error; if (!data || error) return error;
let { run_id, status } = data; const { run_id, status } = data;
const workflow_run = await db const workflow_run = await db
.update(workflowRunsTable) .update(workflowRunsTable)
@ -50,6 +45,6 @@ export async function POST(request: Request) {
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS", "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS",
"Access-Control-Allow-Headers": "Content-Type, Authorization", "Access-Control-Allow-Headers": "Content-Type, Authorization",
}, },
}, }
); );
} }