mirror of
https://github.com/hex248/sprint.git
synced 2026-02-09 18:53:02 +00:00
edit + delete capabilities for org, project, sprint
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Issue, Organisation, Project, User } from "@sprint/shared";
|
||||
import { Issue, Organisation, Project, Sprint, User } from "@sprint/shared";
|
||||
import { eq } from "drizzle-orm";
|
||||
import { db } from "../client";
|
||||
|
||||
@@ -26,6 +26,8 @@ export async function updateProject(
|
||||
export async function deleteProject(projectId: number) {
|
||||
// delete all of the project's issues first
|
||||
await db.delete(Issue).where(eq(Issue.projectId, projectId));
|
||||
// delete all of the project's sprints
|
||||
await db.delete(Sprint).where(eq(Sprint.projectId, projectId));
|
||||
// delete actual project
|
||||
await db.delete(Project).where(eq(Project.id, projectId));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user