Updated the pagination on the useUsers and migrading the grading

This commit is contained in:
Tiago Ribeiro
2024-09-07 16:53:58 +01:00
parent 417c9176fe
commit 56f374bbfe
5 changed files with 45 additions and 41 deletions

View File

@@ -13,14 +13,14 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
return;
}
const {size, type, latestID, firstID} = req.query as {size?: string; type?: Type; latestID?: string; firstID?: string};
const {size, type, page} = req.query as {size?: string; type?: Type; page?: string};
console.log(size, type, page);
const {users, total} = await getLinkedUsers(
req.session.user?.id,
req.session.user?.type,
type,
firstID,
latestID,
page !== undefined ? parseInt(page) : undefined,
size !== undefined ? parseInt(size) : undefined,
);