fix: me endpoint now return the test date if exist
This commit is contained in:
parent
cd681b095f
commit
8e78611aab
|
@ -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
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue