Continued improving this
This commit is contained in:
@@ -13,14 +13,16 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {page, size, type} = req.query as {page?: string; size?: string; type?: Type};
|
||||
const users = await getLinkedUsers(
|
||||
const {size, type, latestID, firstID} = req.query as {size?: string; type?: Type; latestID?: string; firstID?: string};
|
||||
|
||||
const {users, total} = await getLinkedUsers(
|
||||
req.session.user?.id,
|
||||
req.session.user?.type,
|
||||
type,
|
||||
page !== undefined ? parseInt(page) : undefined,
|
||||
firstID,
|
||||
latestID,
|
||||
size !== undefined ? parseInt(size) : undefined,
|
||||
);
|
||||
|
||||
res.status(200).json(users);
|
||||
res.status(200).json({users, total});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user