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:
2026-02-21 22:51:45 +00:00
parent 14890b6875
commit 70726c50dc
13 changed files with 1064 additions and 112 deletions

View File

@@ -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
}
})
}