Update projects.ts

This commit is contained in:
Nathan 2026-03-18 18:36:47 -04:00
parent 8a2749f4bc
commit 49cfdc6662

View file

@ -537,12 +537,16 @@ projects.get("/:id", async ({ params, headers }) => {
};
});
projects.post("/", async ({ body, headers }) => {
return { error: "Scraps has ended. Project creation is disabled." };
const ALLOWED_SLACK_ID = "U0A0T0DFVKR";
projects.post("/", async ({ body, headers }) => {
const user = await getUserFromSession(headers as Record<string, string>);
if (!user) return { error: "Unauthorized" };
if (user.slackId !== ALLOWED_SLACK_ID) {
return { error: "Scraps has ended. Project creation is disabled." };
}
const data = body as {
name: string;
description: string;