diff --git a/apps/web/app/(authed)/memories/[id]/page.tsx b/apps/web/app/(authed)/memories/[id]/page.tsx index e3d0ac0..b4e1695 100644 --- a/apps/web/app/(authed)/memories/[id]/page.tsx +++ b/apps/web/app/(authed)/memories/[id]/page.tsx @@ -1,6 +1,6 @@ import Link from "next/link"; import { notFound } from "next/navigation"; -import { and, eq, isNull } from "drizzle-orm"; +import { and, desc, eq, isNull } from "drizzle-orm"; import { auth } from "@/auth"; import { db } from "@/lib/db/client"; import { memories, projects } from "@/lib/db/schema"; @@ -48,6 +48,15 @@ export default async function MemoryDetailPage({ const isEditing = edit === "1"; + const projectList = isEditing + ? await db + .select({ key: projects.key, displayName: projects.displayName }) + .from(projects) + .where(eq(projects.userId, userId)) + .orderBy(desc(projects.updatedAt)) + .limit(50) + : []; + return (
+
+ + +
+
+ + + {projectList.length > 0 ? ( + + {projectList.map((p) => ( + + ))} + + ) : null} +