From ddfb4977646d8082a3724792dfa5842f74041f52 Mon Sep 17 00:00:00 2001 From: Keith Stevens Date: Sat, 14 Jan 2023 16:57:06 +0900 Subject: [PATCH] Fixing some lint errors and adding a TODO --- website/src/lib/oasst_api_client.ts | 2 +- website/src/pages/api/admin/user_messages.ts | 2 +- website/src/pages/api/admin/users.ts | 9 +-------- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/website/src/lib/oasst_api_client.ts b/website/src/lib/oasst_api_client.ts index 08cd0b56..95e2fb58 100644 --- a/website/src/lib/oasst_api_client.ts +++ b/website/src/lib/oasst_api_client.ts @@ -87,7 +87,7 @@ export class OasstApiClient { return await resp.json(); } - private async put(path: string, body: any): Promise { + private async put(path: string): Promise { const resp = await fetch(`${this.oasstApiUrl}${path}`, { method: "PUT", headers: { diff --git a/website/src/pages/api/admin/user_messages.ts b/website/src/pages/api/admin/user_messages.ts index 67f72a4e..f862bfc0 100644 --- a/website/src/pages/api/admin/user_messages.ts +++ b/website/src/pages/api/admin/user_messages.ts @@ -1,5 +1,5 @@ -import { oasstApiClient } from "src/lib/oasst_api_client"; import { withRole } from "src/lib/auth"; +import { oasstApiClient } from "src/lib/oasst_api_client"; /** * Returns the messages recorded by the backend for a user. diff --git a/website/src/pages/api/admin/users.ts b/website/src/pages/api/admin/users.ts index af1479f2..04bcacf0 100644 --- a/website/src/pages/api/admin/users.ts +++ b/website/src/pages/api/admin/users.ts @@ -2,19 +2,12 @@ import { withRole } from "src/lib/auth"; import { oasstApiClient } from "src/lib/oasst_api_client"; import prisma from "src/lib/prismadb"; -// The number of users to fetch in any request. -const PAGE_SIZE = 20; - /** * Returns a list of user results from the database when the requesting user is * a logged in admin. */ const handler = withRole("admin", async (req, res) => { - // Figure out the pagination index and skip that number of users. - // - // Note: with Prisma this isn't the most efficient but it's the only possible - // option with cuid based User IDs. - const { pageIndex } = req.query; + // TODO(#673): Update this to support pagination. // First, get all the users according to the backend. const all_users = await oasstApiClient.fetch_users(20);