deploy first

This commit is contained in:
2025-09-10 04:31:53 +00:00
parent 2171d5e744
commit 364e91c47a
13 changed files with 235 additions and 135 deletions

View File

@@ -0,0 +1,22 @@
import { NextResponse } from 'next/server'
import { PrismaClient } from '@/app/generated/prisma'
export async function POST(request: Request) {
const prisma = new PrismaClient()
try {
const body = await request.json().catch(() => ({})) as any
const id = String(body?.id || '')
const costPerView = Number(body?.costPerView)
if (!id || !Number.isFinite(costPerView)) {
return NextResponse.json({ error: 'invalid payload' }, { status: 400 })
}
await prisma.handle.update({ where: { id }, data: { costPerView } })
return NextResponse.json({ ok: true })
} catch (e) {
return NextResponse.json({ error: 'update failed' }, { status: 500 })
} finally {
try { await prisma.$disconnect() } catch {}
}
}