mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-05-01 11:19:34 +00:00
Initial Commit
This commit is contained in:
commit
f3e2f01bd7
150 changed files with 13612 additions and 0 deletions
46
app/(platform)/(dashboard)/board/[boardId]/page.tsx
Normal file
46
app/(platform)/(dashboard)/board/[boardId]/page.tsx
Normal file
|
@ -0,0 +1,46 @@
|
|||
import { auth } from "@clerk/nextjs";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import { db } from "@/lib/db";
|
||||
import { ListContainer } from "./_components/list-container";
|
||||
|
||||
interface BoardIdPageProps {
|
||||
params: {
|
||||
boardId: string;
|
||||
};
|
||||
}
|
||||
|
||||
const BoardIdPage = async ({ params }: BoardIdPageProps) => {
|
||||
const { orgId } = auth();
|
||||
|
||||
if (!orgId) {
|
||||
redirect("/select-org");
|
||||
}
|
||||
|
||||
const lists = await db.list.findMany({
|
||||
where: {
|
||||
boardId: params.boardId,
|
||||
board: {
|
||||
orgId,
|
||||
},
|
||||
},
|
||||
include: {
|
||||
cards: {
|
||||
orderBy: {
|
||||
order: "asc",
|
||||
},
|
||||
},
|
||||
},
|
||||
orderBy: {
|
||||
order: "asc",
|
||||
},
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="p-4 h-full overflow-x-auto">
|
||||
<ListContainer boardId={params.boardId} data={lists} />
|
||||
</div>
|
||||
)
|
||||
};
|
||||
|
||||
export default BoardIdPage;
|
Loading…
Add table
Add a link
Reference in a new issue