feat: filter users by name or email

This commit is contained in:
pit
2023-10-06 15:48:05 +03:00
committed by Mythie
parent 02b6f6a7b7
commit 9682f8ea36
7 changed files with 192 additions and 45 deletions

View File

@ -11,12 +11,10 @@ export type DocumentsPageProps = {
};
export default async function Documents({ searchParams = {} }: DocumentsPageProps) {
const user = await getRequiredServerComponentSession();
const page = Number(searchParams.page) || 1;
const perPage = Number(searchParams.perPage) || 20;
const results = await findDocuments({
userId: user.id,
orderBy: {
column: 'createdAt',
direction: 'desc',