mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-26 20:39:07 +01:00
Fix query param pass through.
This commit is contained in:
parent
321f7fd20b
commit
ec0a3fa431
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user