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