fix build
This commit is contained in:
parent
dae6e46a8e
commit
43fe0a384a
@ -44,14 +44,6 @@ async function checkAuth(c: Context, next: Next, headers?: HeadersInit) {
|
|||||||
await next();
|
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("/run", checkAuth);
|
||||||
app.use("/upload-url", checkAuth);
|
app.use("/upload-url", checkAuth);
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
createNewWorkflowVersion,
|
createNewWorkflowVersion,
|
||||||
} from "@/server/createNewWorkflow";
|
} from "@/server/createNewWorkflow";
|
||||||
import { z, createRoute } from "@hono/zod-openapi";
|
import { z, createRoute } from "@hono/zod-openapi";
|
||||||
import { and, eq } from "drizzle-orm";
|
import { and, eq, isNull } from "drizzle-orm";
|
||||||
|
|
||||||
const route = createRoute({
|
const route = createRoute({
|
||||||
method: "post",
|
method: "post",
|
||||||
@ -120,7 +120,9 @@ export const registerWorkflowUploadRoute = (app: App) => {
|
|||||||
and(
|
and(
|
||||||
eq(workflowTable.id, workflow_id),
|
eq(workflowTable.id, workflow_id),
|
||||||
eq(workflowTable.user_id, user_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),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user