admin管理员组文章数量:1123509
My nestjs prisma orm error does not inline with my code. An error in my console is different from what I have in my code. I have deleted my nodemodules, yarnlock file and reinstall, same error every time. I checked prisma docs and I implimented the same thing they have but I still got same error. What could go wrong?
I got this error:
const [total, courses] = await this.databaseService.$transaction([
→ 190 this.databaseService.courses.count({
select: {
_count: {
select: {
_all: true
}
}
},
+ take: Int
})
Argument `take` is missing.
But my code does not use the select clause. I have deleted my nodemodules and reinstall, same isuue.
my code:
async findAllCourses(page: number = 1, limit: number = 10, filters?: any) {
const skip = (page - 1) * limit;
const take = limit;
const where: Prisma.coursesWhereInput = { deleted: false };
if (filters.college_id) {
where.college_id = filters.college_id;
}
if (filters.title) {
where.title = {
contains: filters.title,
mode: 'insensitive',
};
}
if (filters.level) {
where.level = filters.level;
}
const [total, courses] = await this.databaseService.$transaction([
this.databaseService.courses.count(),
this.databaseService.courses.findMany({
where,
include: {
college: true,
course_modules: {
include: {
assignment: {
include: {
questions: true,
},
},
test: {
include: {
questions: true,
},
},
exam: {
include: {
questions: true,
},
},
live_class: true,
},
},
},
skip,
take,
}),
]);
return {
total,
page,
limit,
data: courses,
};
}
本文标签:
版权声明:本文标题:node.js - My nestjs prisma orm error does not inline with my code. An error in my console is different from what I have in my co 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736571000a1944771.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论