From ae82e531b184de4e71dccb352f905ee28461d285 Mon Sep 17 00:00:00 2001 From: Brian Cao Date: Wed, 28 Feb 2024 10:19:22 -0800 Subject: [PATCH] add orderby to query. --- src/pages/api/teams/[teamId]/users/index.ts | 8 +------- src/pages/api/users/[userId]/teams.ts | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/pages/api/teams/[teamId]/users/index.ts b/src/pages/api/teams/[teamId]/users/index.ts index 3c4dfd71..3a03feaf 100644 --- a/src/pages/api/teams/[teamId]/users/index.ts +++ b/src/pages/api/teams/[teamId]/users/index.ts @@ -44,8 +44,6 @@ export default async ( return unauthorized(res); } - const { query, page, pageSize } = req.query; - const users = await getTeamUsers( { where: { @@ -63,11 +61,7 @@ export default async ( }, }, }, - { - query, - page, - pageSize, - }, + req.query, ); return ok(res, users); diff --git a/src/pages/api/users/[userId]/teams.ts b/src/pages/api/users/[userId]/teams.ts index dda65355..279df1e3 100644 --- a/src/pages/api/users/[userId]/teams.ts +++ b/src/pages/api/users/[userId]/teams.ts @@ -39,13 +39,7 @@ export default async ( return unauthorized(res); } - const { page, query, pageSize } = req.query; - - const teams = await getUserTeams(userId as string, { - query, - page, - pageSize, - }); + const teams = await getUserTeams(userId as string, req.query); return ok(res, teams); }