mirror of
https://github.com/System-End/scraps.git
synced 2026-04-20 00:25:18 +00:00
Update projects.ts
This commit is contained in:
parent
8a2749f4bc
commit
49cfdc6662
1 changed files with 6 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue