diff --git a/src/db.ts b/src/db.ts index b5bf6ce..9b24f1b 100644 --- a/src/db.ts +++ b/src/db.ts @@ -1,5 +1,5 @@ import { PrismaClient } from "@prisma/client"; const prisma = new PrismaClient(); - +export const PAGE_SIZE = 10; export default prisma; diff --git a/src/handlers/contribution.ts b/src/handlers/contribution.ts index c24777b..9dad26a 100644 --- a/src/handlers/contribution.ts +++ b/src/handlers/contribution.ts @@ -1,5 +1,5 @@ import { NextFunction, Request, Response } from "express"; -import prisma from "../db.js"; +import prisma, { PAGE_SIZE } from "../db.js"; import CustomError from "../modules/errors.js"; export async function approveContribution( req: Request, diff --git a/src/handlers/task.ts b/src/handlers/task.ts index 9948eed..7c2ba4c 100644 --- a/src/handlers/task.ts +++ b/src/handlers/task.ts @@ -1,5 +1,5 @@ import { NextFunction, Request, Response } from "express"; -import prisma from "../db.js"; +import prisma, { PAGE_SIZE } from "../db.js"; import CustomError from "../modules/errors.js"; export async function createTask( diff --git a/src/index.d.ts b/src/index.d.ts index 0342d31..580e017 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,6 +1,5 @@ import { User } from "./modules/auth.ts"; declare global { - const PAGE_SIZE = 10; namespace Express { export interface Request { user?: User;