mirror of
https://github.com/hex248/sprint.git
synced 2026-02-07 18:23:03 +00:00
Project.blob -> Project.key
This commit is contained in:
1
packages/backend/drizzle/0006_wise_kree.sql
Normal file
1
packages/backend/drizzle/0006_wise_kree.sql
Normal file
@@ -0,0 +1 @@
|
||||
ALTER TABLE "Project" RENAME COLUMN "blob" TO "key";
|
||||
431
packages/backend/drizzle/meta/0006_snapshot.json
Normal file
431
packages/backend/drizzle/meta/0006_snapshot.json
Normal file
@@ -0,0 +1,431 @@
|
||||
{
|
||||
"id": "e65db5fa-6d8f-43f1-aea1-154a085302bc",
|
||||
"prevId": "c7a99155-1dc7-414d-88b6-8f485daa0c58",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
"tables": {
|
||||
"public.Issue": {
|
||||
"name": "Issue",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"identity": {
|
||||
"type": "always",
|
||||
"name": "Issue_id_seq",
|
||||
"schema": "public",
|
||||
"increment": "1",
|
||||
"startWith": "1",
|
||||
"minValue": "1",
|
||||
"maxValue": "2147483647",
|
||||
"cache": "1",
|
||||
"cycle": false
|
||||
}
|
||||
},
|
||||
"projectId": {
|
||||
"name": "projectId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"number": {
|
||||
"name": "number",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"title": {
|
||||
"name": "title",
|
||||
"type": "varchar(256)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "varchar(2048)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"assigneeId": {
|
||||
"name": "assigneeId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
}
|
||||
},
|
||||
"indexes": {
|
||||
"unique_project_issue_number": {
|
||||
"name": "unique_project_issue_number",
|
||||
"columns": [
|
||||
{
|
||||
"expression": "projectId",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
},
|
||||
{
|
||||
"expression": "number",
|
||||
"isExpression": false,
|
||||
"asc": true,
|
||||
"nulls": "last"
|
||||
}
|
||||
],
|
||||
"isUnique": true,
|
||||
"concurrently": false,
|
||||
"method": "btree",
|
||||
"with": {}
|
||||
}
|
||||
},
|
||||
"foreignKeys": {
|
||||
"Issue_projectId_Project_id_fk": {
|
||||
"name": "Issue_projectId_Project_id_fk",
|
||||
"tableFrom": "Issue",
|
||||
"tableTo": "Project",
|
||||
"columnsFrom": [
|
||||
"projectId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"Issue_assigneeId_User_id_fk": {
|
||||
"name": "Issue_assigneeId_User_id_fk",
|
||||
"tableFrom": "Issue",
|
||||
"tableTo": "User",
|
||||
"columnsFrom": [
|
||||
"assigneeId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.Organisation": {
|
||||
"name": "Organisation",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"identity": {
|
||||
"type": "always",
|
||||
"name": "Organisation_id_seq",
|
||||
"schema": "public",
|
||||
"increment": "1",
|
||||
"startWith": "1",
|
||||
"minValue": "1",
|
||||
"maxValue": "2147483647",
|
||||
"cache": "1",
|
||||
"cycle": false
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "varchar(256)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"description": {
|
||||
"name": "description",
|
||||
"type": "varchar(1024)",
|
||||
"primaryKey": false,
|
||||
"notNull": false
|
||||
},
|
||||
"slug": {
|
||||
"name": "slug",
|
||||
"type": "varchar(64)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"default": "now()"
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {
|
||||
"Organisation_slug_unique": {
|
||||
"name": "Organisation_slug_unique",
|
||||
"nullsNotDistinct": false,
|
||||
"columns": [
|
||||
"slug"
|
||||
]
|
||||
}
|
||||
},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.OrganisationMember": {
|
||||
"name": "OrganisationMember",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"identity": {
|
||||
"type": "always",
|
||||
"name": "OrganisationMember_id_seq",
|
||||
"schema": "public",
|
||||
"increment": "1",
|
||||
"startWith": "1",
|
||||
"minValue": "1",
|
||||
"maxValue": "2147483647",
|
||||
"cache": "1",
|
||||
"cycle": false
|
||||
}
|
||||
},
|
||||
"organisationId": {
|
||||
"name": "organisationId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"userId": {
|
||||
"name": "userId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"role": {
|
||||
"name": "role",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"OrganisationMember_organisationId_Organisation_id_fk": {
|
||||
"name": "OrganisationMember_organisationId_Organisation_id_fk",
|
||||
"tableFrom": "OrganisationMember",
|
||||
"tableTo": "Organisation",
|
||||
"columnsFrom": [
|
||||
"organisationId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"OrganisationMember_userId_User_id_fk": {
|
||||
"name": "OrganisationMember_userId_User_id_fk",
|
||||
"tableFrom": "OrganisationMember",
|
||||
"tableTo": "User",
|
||||
"columnsFrom": [
|
||||
"userId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.Project": {
|
||||
"name": "Project",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"identity": {
|
||||
"type": "always",
|
||||
"name": "Project_id_seq",
|
||||
"schema": "public",
|
||||
"increment": "1",
|
||||
"startWith": "1",
|
||||
"minValue": "1",
|
||||
"maxValue": "2147483647",
|
||||
"cache": "1",
|
||||
"cycle": false
|
||||
}
|
||||
},
|
||||
"key": {
|
||||
"name": "key",
|
||||
"type": "varchar(4)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "varchar(256)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"organisationId": {
|
||||
"name": "organisationId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"creatorId": {
|
||||
"name": "creatorId",
|
||||
"type": "integer",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {
|
||||
"Project_organisationId_Organisation_id_fk": {
|
||||
"name": "Project_organisationId_Organisation_id_fk",
|
||||
"tableFrom": "Project",
|
||||
"tableTo": "Organisation",
|
||||
"columnsFrom": [
|
||||
"organisationId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
},
|
||||
"Project_creatorId_User_id_fk": {
|
||||
"name": "Project_creatorId_User_id_fk",
|
||||
"tableFrom": "Project",
|
||||
"tableTo": "User",
|
||||
"columnsFrom": [
|
||||
"creatorId"
|
||||
],
|
||||
"columnsTo": [
|
||||
"id"
|
||||
],
|
||||
"onDelete": "no action",
|
||||
"onUpdate": "no action"
|
||||
}
|
||||
},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
},
|
||||
"public.User": {
|
||||
"name": "User",
|
||||
"schema": "",
|
||||
"columns": {
|
||||
"id": {
|
||||
"name": "id",
|
||||
"type": "integer",
|
||||
"primaryKey": true,
|
||||
"notNull": true,
|
||||
"identity": {
|
||||
"type": "always",
|
||||
"name": "User_id_seq",
|
||||
"schema": "public",
|
||||
"increment": "1",
|
||||
"startWith": "1",
|
||||
"minValue": "1",
|
||||
"maxValue": "2147483647",
|
||||
"cache": "1",
|
||||
"cycle": false
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"name": "name",
|
||||
"type": "varchar(256)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"username": {
|
||||
"name": "username",
|
||||
"type": "varchar(32)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"passwordHash": {
|
||||
"name": "passwordHash",
|
||||
"type": "varchar(255)",
|
||||
"primaryKey": false,
|
||||
"notNull": true
|
||||
},
|
||||
"createdAt": {
|
||||
"name": "createdAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"default": "now()"
|
||||
},
|
||||
"updatedAt": {
|
||||
"name": "updatedAt",
|
||||
"type": "timestamp",
|
||||
"primaryKey": false,
|
||||
"notNull": false,
|
||||
"default": "now()"
|
||||
}
|
||||
},
|
||||
"indexes": {},
|
||||
"foreignKeys": {},
|
||||
"compositePrimaryKeys": {},
|
||||
"uniqueConstraints": {
|
||||
"User_username_unique": {
|
||||
"name": "User_username_unique",
|
||||
"nullsNotDistinct": false,
|
||||
"columns": [
|
||||
"username"
|
||||
]
|
||||
}
|
||||
},
|
||||
"policies": {},
|
||||
"checkConstraints": {},
|
||||
"isRLSEnabled": false
|
||||
}
|
||||
},
|
||||
"enums": {},
|
||||
"schemas": {},
|
||||
"sequences": {},
|
||||
"roles": {},
|
||||
"policies": {},
|
||||
"views": {},
|
||||
"_meta": {
|
||||
"columns": {},
|
||||
"schemas": {},
|
||||
"tables": {}
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,13 @@
|
||||
"when": 1766433489198,
|
||||
"tag": "0005_great_timeslip",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 6,
|
||||
"version": "7",
|
||||
"when": 1766988874206,
|
||||
"tag": "0006_wise_kree",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,11 +2,11 @@ import { Issue, Organisation, Project, User } from "@issue/shared";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { db } from "../client";
|
||||
|
||||
export async function createProject(blob: string, name: string, creatorId: number, organisationId: number) {
|
||||
export async function createProject(key: string, name: string, creatorId: number, organisationId: number) {
|
||||
const [project] = await db
|
||||
.insert(Project)
|
||||
.values({
|
||||
blob,
|
||||
key,
|
||||
name,
|
||||
creatorId,
|
||||
organisationId,
|
||||
@@ -17,7 +17,7 @@ export async function createProject(blob: string, name: string, creatorId: numbe
|
||||
|
||||
export async function updateProject(
|
||||
projectId: number,
|
||||
updates: { blob?: string; name?: string; creatorId?: number; organisationId?: number },
|
||||
updates: { key?: string; name?: string; creatorId?: number; organisationId?: number },
|
||||
) {
|
||||
const [project] = await db.update(Project).set(updates).where(eq(Project.id, projectId)).returning();
|
||||
return project;
|
||||
@@ -35,8 +35,8 @@ export async function getProjectByID(projectId: number) {
|
||||
return project;
|
||||
}
|
||||
|
||||
export async function getProjectByBlob(projectBlob: string) {
|
||||
const [project] = await db.select().from(Project).where(eq(Project.blob, projectBlob));
|
||||
export async function getProjectByKey(projectKey: string) {
|
||||
const [project] = await db.select().from(Project).where(eq(Project.key, projectKey));
|
||||
return project;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ const main = async () => {
|
||||
"/issue/create": withCors(withAuth(routes.issueCreate)),
|
||||
"/issue/update": withCors(withAuth(routes.issueUpdate)),
|
||||
"/issue/delete": withCors(withAuth(routes.issueDelete)),
|
||||
"/issues/:projectBlob": withCors(withAuth(routes.issuesInProject)),
|
||||
"/issues/:projectKey": withCors(withAuth(routes.issuesInProject)),
|
||||
"/issues/all": withCors(withAuth(routes.issues)),
|
||||
|
||||
"/organisation/create": withCors(withAuth(routes.organisationCreate)),
|
||||
|
||||
@@ -4,7 +4,7 @@ import authRegister from "./auth/register";
|
||||
import issueCreate from "./issue/create";
|
||||
import issueDelete from "./issue/delete";
|
||||
import issueUpdate from "./issue/update";
|
||||
import issuesInProject from "./issues/[projectBlob]";
|
||||
import issuesInProject from "./issues/[projectKey]";
|
||||
import issues from "./issues/all";
|
||||
import organisationAddMember from "./organisation/add-member";
|
||||
import organisationById from "./organisation/by-id";
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
import type { BunRequest } from "bun";
|
||||
import { createIssue, getProjectByID, getProjectByBlob } from "../../db/queries";
|
||||
import { createIssue, getProjectByID, getProjectByKey } from "../../db/queries";
|
||||
|
||||
// /issue/create?projectId=1&title=Testing&description=Description
|
||||
// OR
|
||||
// /issue/create?projectBlob=projectBlob&title=Testing&description=Description
|
||||
// /issue/create?projectKey=projectKey&title=Testing&description=Description
|
||||
export default async function issueCreate(req: BunRequest) {
|
||||
const url = new URL(req.url);
|
||||
const projectId = url.searchParams.get("projectId");
|
||||
const projectBlob = url.searchParams.get("projectBlob");
|
||||
const projectKey = url.searchParams.get("projectKey");
|
||||
|
||||
let project = null;
|
||||
if (projectId) {
|
||||
project = await getProjectByID(Number(projectId));
|
||||
} else if (projectBlob) {
|
||||
project = await getProjectByBlob(projectBlob);
|
||||
} else if (projectKey) {
|
||||
project = await getProjectByKey(projectKey);
|
||||
} else {
|
||||
return new Response("missing project blob or project id", { status: 400 });
|
||||
return new Response("missing project key or project id", { status: 400 });
|
||||
}
|
||||
if (!project) {
|
||||
return new Response(`project not found: provided ${projectId ?? projectBlob}`, { status: 404 });
|
||||
return new Response(`project not found: provided ${projectId ?? projectKey}`, { status: 404 });
|
||||
}
|
||||
|
||||
const title = url.searchParams.get("title") || "Untitled Issue";
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { BunRequest } from "bun";
|
||||
import { getIssuesWithAssigneeByProject, getProjectByBlob } from "../../db/queries";
|
||||
import { getIssuesWithAssigneeByProject, getProjectByKey } from "../../db/queries";
|
||||
|
||||
export default async function issuesInProject(req: BunRequest<"/issues/:projectBlob">) {
|
||||
const { projectBlob } = req.params;
|
||||
export default async function issuesInProject(req: BunRequest<"/issues/:projectKey">) {
|
||||
const { projectKey } = req.params;
|
||||
|
||||
const project = await getProjectByBlob(projectBlob);
|
||||
const project = await getProjectByKey(projectKey);
|
||||
if (!project) {
|
||||
return new Response(`project not found: provided ${projectBlob}`, { status: 404 });
|
||||
return new Response(`project not found: provided ${projectKey}`, { status: 404 });
|
||||
}
|
||||
const issues = await getIssuesWithAssigneeByProject(project.id);
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
import type { BunRequest } from "bun";
|
||||
import { createProject, getProjectByBlob, getUserById } from "../../db/queries";
|
||||
import { createProject, getProjectByKey, getUserById } from "../../db/queries";
|
||||
|
||||
// /project/create?blob=BLOB&name=Testing&creatorId=1&organisationId=1
|
||||
// /project/create?key=KEY&name=Testing&creatorId=1&organisationId=1
|
||||
export default async function projectCreate(req: BunRequest) {
|
||||
const url = new URL(req.url);
|
||||
const blob = url.searchParams.get("blob");
|
||||
const key = url.searchParams.get("key");
|
||||
const name = url.searchParams.get("name");
|
||||
const creatorId = url.searchParams.get("creatorId");
|
||||
const organisationId = url.searchParams.get("organisationId");
|
||||
|
||||
if (!blob || !name || !creatorId || !organisationId) {
|
||||
if (!key || !name || !creatorId || !organisationId) {
|
||||
return new Response(
|
||||
`missing parameters: ${!blob ? "blob " : ""}${!name ? "name " : ""}${!creatorId ? "creatorId " : ""}${!organisationId ? "organisationId" : ""}`,
|
||||
`missing parameters: ${!key ? "key " : ""}${!name ? "name " : ""}${!creatorId ? "creatorId " : ""}${!organisationId ? "organisationId" : ""}`,
|
||||
{ status: 400 },
|
||||
);
|
||||
}
|
||||
|
||||
// check if project with blob already exists in the organisation
|
||||
const existingProject = await getProjectByBlob(blob);
|
||||
// check if project with key already exists in the organisation
|
||||
const existingProject = await getProjectByKey(key);
|
||||
if (existingProject?.organisationId === parseInt(organisationId, 10)) {
|
||||
return new Response(`project with blob ${blob} already exists`, { status: 400 });
|
||||
return new Response(`project with key ${key} already exists`, { status: 400 });
|
||||
}
|
||||
|
||||
const creator = await getUserById(parseInt(creatorId, 10));
|
||||
@@ -27,7 +27,7 @@ export default async function projectCreate(req: BunRequest) {
|
||||
return new Response(`creator with id ${creatorId} not found`, { status: 404 });
|
||||
}
|
||||
|
||||
const project = await createProject(blob, name, creator.id, parseInt(organisationId, 10));
|
||||
const project = await createProject(key, name, creator.id, parseInt(organisationId, 10));
|
||||
|
||||
return Response.json(project);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { BunRequest } from "bun";
|
||||
import { getProjectByBlob, getProjectByID, getUserById, updateProject } from "../../db/queries";
|
||||
import { getProjectByID, getProjectByKey, getUserById, updateProject } from "../../db/queries";
|
||||
|
||||
// /project/update?id=1&blob=NEW&name=new%20name&creatorId=1&organisationId=1
|
||||
// /project/update?id=1&key=NEW&name=new%20name&creatorId=1&organisationId=1
|
||||
export default async function projectUpdate(req: BunRequest) {
|
||||
const url = new URL(req.url);
|
||||
const id = url.searchParams.get("id");
|
||||
const blob = url.searchParams.get("blob") || undefined;
|
||||
const key = url.searchParams.get("key") || undefined;
|
||||
const name = url.searchParams.get("name") || undefined;
|
||||
const creatorId = url.searchParams.get("creatorId") || undefined;
|
||||
const organisationId = url.searchParams.get("organisationId") || undefined;
|
||||
@@ -19,15 +19,15 @@ export default async function projectUpdate(req: BunRequest) {
|
||||
return new Response(`project with id ${id} does not exist`, { status: 404 });
|
||||
}
|
||||
|
||||
if (!blob && !name && !creatorId && !organisationId) {
|
||||
return new Response(`at least one of blob, name, creatorId, or organisationId must be provided`, {
|
||||
if (!key && !name && !creatorId && !organisationId) {
|
||||
return new Response(`at least one of key, name, creatorId, or organisationId must be provided`, {
|
||||
status: 400,
|
||||
});
|
||||
}
|
||||
|
||||
const projectWithBlob = blob ? await getProjectByBlob(blob) : null;
|
||||
if (projectWithBlob && projectWithBlob.id !== Number(id)) {
|
||||
return new Response(`a project with blob "${blob}" already exists`, { status: 400 });
|
||||
const projectWithKey = key ? await getProjectByKey(key) : null;
|
||||
if (projectWithKey && projectWithKey.id !== Number(id)) {
|
||||
return new Response(`a project with key "${key}" already exists`, { status: 400 });
|
||||
}
|
||||
|
||||
const newCreator = creatorId ? await getUserById(Number(creatorId)) : null;
|
||||
@@ -36,8 +36,8 @@ export default async function projectUpdate(req: BunRequest) {
|
||||
}
|
||||
|
||||
const project = await updateProject(Number(id), {
|
||||
blob: blob,
|
||||
name: name,
|
||||
key,
|
||||
name,
|
||||
creatorId: newCreator?.id,
|
||||
organisationId: organisationId ? Number(organisationId) : undefined,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user