EnricoBaivo
EnricoBaivo
Explore posts from servers
PPrisma
Created by EnricoBaivo on 7/30/2024 in #help-and-questions
struggle with conditional query
i have a query where i want to have a condtional filtering for userscores in a prediction but when i do so it dosnt have a effect on true or false. What am i doing wrong ?
{
where: {
id: { gte: cursor },
mode: 0,
userscore: input.displayOnlyUnplayedPredictions
? {
none: {
// Ensures that no Userscore related to this Prediction has the cified osu_user_id
AND: [
{
osu_user_id: ctx.session.user.osu_user_id,
},
{
accuracy: {
gte: input.displayOnlyUnplayedBeatmapsWithAcuuracyAbove,
},
},
],
},
}
: {},
}
}
{
where: {
id: { gte: cursor },
mode: 0,
userscore: input.displayOnlyUnplayedPredictions
? {
none: {
// Ensures that no Userscore related to this Prediction has the cified osu_user_id
AND: [
{
osu_user_id: ctx.session.user.osu_user_id,
},
{
accuracy: {
gte: input.displayOnlyUnplayedBeatmapsWithAcuuracyAbove,
},
},
],
},
}
: {},
}
}
if remove the condtion it works
5 replies
TTCTheo's Typesafe Cult
Created by EnricoBaivo on 12/14/2023 in #questions
T3, Next.js, Drizzle-adapter, next-auth v5 database User login with extended Fields for User
Hello guys, did some one tried to add extra columns to the User table for the drizzle adapter for a next and next-auth v5 t3 stack ?
3 replies