1
0
mirror of https://github.com/Fayorg/calendrier-avant.git synced 2026-05-27 17:18:38 +02:00

fix: removed unused database fields & fix prisma errors

This commit is contained in:
2023-12-20 10:20:21 +01:00
parent da3a9df402
commit b47b59f4cd
5 changed files with 12 additions and 23 deletions

View File

@@ -8,7 +8,6 @@ export async function getGrade(testId: number, userId: number) {
grade: true,
id: true,
testId: true,
note: true,
createdAt: true,
},
where: {
@@ -24,7 +23,6 @@ export async function addGrade(testId: number, userId: number, grade: number, no
const newGrade = await prisma.grade.create({
data: {
grade: grade,
note: note,
testId: testId,
userId: userId,
}

View File

@@ -16,7 +16,6 @@ export async function getActiveTest(date: Date) {
select: {
id: true,
isActive: true,
isPassed: true,
testOf: {
select: {
id: true,
@@ -30,7 +29,6 @@ export async function getActiveTest(date: Date) {
},
where: {
isActive: true,
isPassed: false,
testOn: new Date(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + (date.getDate().toString().length === 1 ? '0' + date.getDate() : date.getDate())),
},
});
@@ -41,7 +39,6 @@ export async function getActiveTestWithGrade(date: Date, userId: number) {
select: {
id: true,
isActive: true,
isPassed: true,
testOf: {
select: {
id: true,
@@ -54,7 +51,6 @@ export async function getActiveTestWithGrade(date: Date, userId: number) {
select: {
id: true,
grade: true,
note: true,
createdAt: true,
},
take: 1,
@@ -67,7 +63,6 @@ export async function getActiveTestWithGrade(date: Date, userId: number) {
},
where: {
isActive: true,
isPassed: false,
testOn: new Date(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + (date.getDate().toString().length === 1 ? '0' + date.getDate() : date.getDate())),
},
});