fix: resolve multiple runtime and build issues
- Fix network binding to allow external access (0.0.0.0) - Upgrade to Node.js 20.x for Next.js 16 compatibility - Fix next-auth v4 configuration and session handling - Add Steam client secret for Steam OAuth provider - Fix Prisma schema unique constraint syntax - Fix database creation script for automated deployment - Fix game search API to use new IStoreService endpoint - Fix session auth in API routes for Steam linking - Add TypeScript types for next-auth session
This commit is contained in:
@@ -30,29 +30,29 @@ export async function POST(
|
||||
const existingVote = await prisma.vote.findUnique({
|
||||
where: {
|
||||
user_review_unique: {
|
||||
user_id: session.user.id,
|
||||
review_id: resolvedParams.id
|
||||
userId: session.user.id,
|
||||
reviewId: resolvedParams.id
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (existingVote) {
|
||||
if (existingVote.vote_type === voteType) {
|
||||
if (existingVote.voteType === voteType) {
|
||||
await prisma.vote.delete({
|
||||
where: { id: existingVote.id }
|
||||
})
|
||||
} else {
|
||||
await prisma.vote.update({
|
||||
where: { id: existingVote.id },
|
||||
data: { vote_type: voteType }
|
||||
data: { voteType: voteType }
|
||||
})
|
||||
}
|
||||
} else {
|
||||
await prisma.vote.create({
|
||||
data: {
|
||||
user_id: session.user.id,
|
||||
review_id: resolvedParams.id,
|
||||
vote_type: voteType
|
||||
userId: session.user.id,
|
||||
reviewId: resolvedParams.id,
|
||||
voteType: voteType
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user