Моя ошибка negjs prisma orm не встроена в мой код. Ошибка в моей консоли отличается от той, что есть в моем коде. Я удалил свои nodemodules, файл Yarnlock и переустановил, каждый раз одна и та же ошибка. Я проверил документацию Prisma и внедрил то же самое, что и они, но все равно получил ту же ошибку. Что может пойти не так?
У меня возникла такая ошибка:
const [total, courses] = await this.databaseService.$transaction([
→ 190 this.databaseService.courses.count({
select: {
_count: {
select: {
_all: true
}
}
},
+ take: Int
})
Argument `take` is missing.
Но в моем коде предложение select не используется. Я удалил модули узлов и переустановил, та же проблема.
мой код:
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,
};
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... my-console