Skip to content

Commit

Permalink
Add missing parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
briancao committed Oct 13, 2023
1 parent 0e782f3 commit 94a2722
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/pages/api/users/[id]/websites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ export default async (
await useValidate(schema, req, res);

const { user } = req.auth;
const { id: userId, page = 1, query = '', includeTeams, onlyTeams } = req.query;
const {
id: userId,
page = 1,
pageSize,
orderBy,
query = '',
includeTeams,
onlyTeams,
} = req.query;

if (req.method === 'GET') {
if (!user.isAdmin && user.id !== userId) {
Expand All @@ -39,7 +47,9 @@ export default async (

const websites = await getWebsitesByUserId(userId, {
page,
pageSize,
query,
orderBy,
includeTeams,
onlyTeams,
});
Expand Down

0 comments on commit 94a2722

Please sign in to comment.