I am using a package prisma-offset-pagination to apply pagination. For this I have to use Prisma Model in my code, how is that possible: Check line: 02
const result = prismaOffsetPagination({
model: user, // How to access prisma model like in this example.
cursor: <cursor>,
size: 5,
buttonNum: 7,
orderBy: 'id',
orderDirection: 'desc',
prisma: prisma,
});
I tried it using the code below but it didn't work and throws an error : UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toLowerCase' of undefined at prismaOffsetPagination
import pClient from '@prisma/client'
const { PrismaClient } = pClient
const { prisma } = new PrismaClient()
const result = prismaOffsetPagination({
model: prisma.user,
cursor: 2,
size: 5,
buttonNum: 3,
orderBy: 'id',
orderDirection: 'desc',
})