mirror of
https://github.com/ahmadk953/tasko.git
synced 2025-01-31 17:03:38 +00:00
46 lines
838 B
TypeScript
46 lines
838 B
TypeScript
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='h-full overflow-x-auto p-4'>
|
|
<ListContainer boardId={params.boardId} data={lists} />
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default BoardIdPage;
|