You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
first: only the model. (prisma.cars_model)
second: findMany options. (only one object containing all the options except skip & take) ({ where, include, ... })
third: The pagination option which are ({ perPage: 10, page: 1})
Also, you don't need to await the first argument, it's just a reference to your model so that the paginate function later invokes .count and .findMany of it.
await paginate(await prisma.cars_model, {
where: {
cars_generation: {
every: {
cars_modification: {
every: {
body_type: {
contains: bodyType,
},
},
},
},
},
},
include: {
cars_generation: {
include: {
cars_modification: {
where: {
body_type: {
contains: bodyType,
},
},
},
},
},
},
take: 10,
skip: 0,
page: page,
})
I am trying to implement this code
const result = await paginate<User, Prisma.UserFindManyArgs>(
prisma.user,
{
where: {
name: {
contains: 'Alice'
}
}
orderBy: {
id: 'desc',
}
},
{ page: query.page }
})
The text was updated successfully, but these errors were encountered: