kaneo (minimalist kanban) fork to experiment adding a tangled integration github.com/usekaneo/kaneo
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 36 lines 925 B view raw
1import { and, eq } from "drizzle-orm"; 2import { HTTPException } from "hono/http-exception"; 3import db from "../../database"; 4import { projectTable } from "../../database/schema"; 5 6async function unarchiveProject(id: string, workspaceId: string) { 7 const [existingProject] = await db 8 .select() 9 .from(projectTable) 10 .where( 11 and(eq(projectTable.id, id), eq(projectTable.workspaceId, workspaceId)), 12 ); 13 14 if (!existingProject) { 15 throw new HTTPException(404, { 16 message: 17 "Project doesn't exist or doesn't belong to the specified workspace", 18 }); 19 } 20 21 const [unarchivedProject] = await db 22 .update(projectTable) 23 .set({ archivedAt: null }) 24 .where(eq(projectTable.id, id)) 25 .returning(); 26 27 if (!unarchivedProject) { 28 throw new HTTPException(500, { 29 message: "Failed to unarchive project", 30 }); 31 } 32 33 return unarchivedProject; 34} 35 36export default unarchiveProject;