Closed dhtmdgkr123 closed 1 year ago
Hi, before calling withPages
you need to call paginate
method. The correct code:
return await this.prismaService.usermodels.paginate().withPages({
limit: 10,
page: 2,
includePageCount: true,
});
Hi, before calling
withPages
you need to callpaginate
method. The correct code:return await this.prismaService.usermodels.paginate().withPages({ limit: 10, page: 2, includePageCount: true, });
xPrisma.ts is below that code
import { PrismaClient } from '@prisma/client';
import { ConfigService } from '@config/config.service';
import pagination from 'prisma-extension-pagination';
const xPrisma = new PrismaClient({
datasources: {
db: {
url: new ConfigService().DB_ENDPOINT,
},
},
});
xPrisma.$extends(pagination);
export { xPrisma };
import { xPrisma } from '@/prisma/xPrisma';
return await xPrisma.usermodels.paginate().withPages({
limit: 10,
page: 2,
includePageCount: true,
});
and that code occure error
src/**/user.repository.ts:15:37 - error TS2339: Property 'paginate' does not exist on type 'usermodelsDelegate<DefaultArgs>'.
15 return await xPrisma.usermodels.paginate().withPages({
~~~~~~~~
Envoriment is sameㅠㅠㅠ
OMG It working u save my life thank u ~~ 💯
Node Version: v18.16.1 Typescript Version: 5.1.6 Nest Version: 10.1.0 Prisma Client Version: 5.0.0
tsconfig.json
Error message:
Reproduce Code