Fix query param pass through.

This commit is contained in:
Brian Cao 2023-10-17 21:55:54 -07:00
parent 321f7fd20b
commit ec0a3fa431

View File

@ -30,15 +30,7 @@ export default async (
await useValidate(schema, req, res); await useValidate(schema, req, res);
const { user } = req.auth; const { user } = req.auth;
const { const { id: userId, page = 1, pageSize, query = '', ...rest } = req.query;
id: userId,
page = 1,
pageSize,
orderBy,
query = '',
includeTeams,
onlyTeams,
} = req.query;
if (req.method === 'GET') { if (req.method === 'GET') {
if (!user.isAdmin && user.id !== userId) { if (!user.isAdmin && user.id !== userId) {
@ -49,9 +41,7 @@ export default async (
page, page,
pageSize: +pageSize || undefined, pageSize: +pageSize || undefined,
query, query,
orderBy, ...rest,
includeTeams,
onlyTeams,
}); });
return ok(res, websites); return ok(res, websites);