(req: NextRequest)
| 21 | |
| 22 | /** PUT — mark session as scanned (mobile calls this on page load) */ |
| 23 | export async function PUT(req: NextRequest) { |
| 24 | const { sessionId } = await req.json(); |
| 25 | if (!sessionId) return NextResponse.json({ error: "missing sessionId" }, { status: 400 }); |
| 26 | |
| 27 | const existing = getSession(sessionId); |
| 28 | if (!existing || existing.status === "waiting") { |
| 29 | setSession(sessionId, { status: "scanned" }); |
| 30 | } |
| 31 | |
| 32 | return NextResponse.json({ ok: true }); |
| 33 | } |
| 34 | |
| 35 | /** POST — submit picked prompt (mobile calls this when user picks an option) */ |
| 36 | export async function POST(req: NextRequest) { |
nothing calls this directly
no test coverage detected