Fixing some lint errors and adding a TODO

This commit is contained in:
Keith Stevens
2023-01-14 16:57:06 +09:00
parent f9c8d1dd81
commit ddfb497764
3 changed files with 3 additions and 10 deletions
+1 -8
View File
@@ -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);