fix build

This commit is contained in:
BennyKok 2024-01-23 10:33:45 +08:00
parent dae6e46a8e
commit 43fe0a384a
2 changed files with 4 additions and 10 deletions

View File

@ -44,14 +44,6 @@ async function checkAuth(c: Context, next: Next, headers?: HeadersInit) {
await next();
}
async function checkAuthCORS(c: Context, next: Next) {
return checkAuth(c, next, {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
"Access-Control-Allow-Headers": "Content-Type, Authorization",
});
}
app.use("/run", checkAuth);
app.use("/upload-url", checkAuth);

View File

@ -12,7 +12,7 @@ import {
createNewWorkflowVersion,
} from "@/server/createNewWorkflow";
import { z, createRoute } from "@hono/zod-openapi";
import { and, eq } from "drizzle-orm";
import { and, eq, isNull } from "drizzle-orm";
const route = createRoute({
method: "post",
@ -120,7 +120,9 @@ export const registerWorkflowUploadRoute = (app: App) => {
and(
eq(workflowTable.id, workflow_id),
eq(workflowTable.user_id, user_id),
eq(workflowTable.org_id, org_id),
org_id
? eq(workflowTable.org_id, org_id)
: isNull(workflowTable.org_id),
),
);