fix: Do not rely on class names in production bundle (#6212)

This commit is contained in:
Tom Moor
2023-11-24 12:59:57 -05:00
committed by GitHub
parent 13a6f89640
commit b9767a9fdc
38 changed files with 202 additions and 86 deletions

View File

@@ -1,14 +1,15 @@
import querystring from "querystring";
import { Next } from "koa";
import { Pagination } from "@shared/constants";
import { InvalidRequestError } from "@server/errors";
import { AppContext } from "@server/types";
export default function pagination() {
return async function paginationMiddleware(ctx: AppContext, next: Next) {
const opts = {
defaultLimit: 15,
defaultOffset: 0,
maxLimit: 100,
defaultLimit: Pagination.defaultLimit,
defaultOffset: Pagination.defaultOffset,
maxLimit: Pagination.maxLimit,
};
const query = ctx.request.query;
const body = ctx.request.body;