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

fix: me endpoint now return the test date if exist

This commit is contained in:
2023-12-05 22:16:41 +01:00
parent cd681b095f
commit 8e78611aab

View File

@@ -7,6 +7,17 @@ export async function GET(req: NextRequest){
if(!key) return NextResponse.json({error: "No key provided"}, {status: 400});
const user = await prisma.users.findUnique({
select: {
id: true,
firstName: true,
lastName: true,
isTeacher: true,
test: {
select: {
testOn: true
}
}
},
where: {
key
}
@@ -19,6 +30,7 @@ export async function GET(req: NextRequest){
firstName: user.firstName,
lastName: user.lastName,
isTeacher: user.isTeacher,
testOn: user.test?.testOn
});
}