im not sure whats wrong with my logic here.. so i ...
# orm-help
j
im not sure whats wrong with my logic here.. so i dont have any records in my token table so far... using upsert should find record if it exists where user_id = 1 If it finds row with user_id = 1 then it should update the token column.. if it doesnt exist, then create: { user_id and token } and insert
await prisma.token.upsert({
where: {
'user_id': dbUser.user_id
},
data: {
'token': refreshToken
},
create: {
'user_id': dbUser.user_id,
'token': refreshToken
}
});