Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
.next
.env*.local
tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export async function PUT(req: Request, { params }: { params: { id: string, tran
if (txs.length === 0) return NextResponse.json({ error: 'Transaction not found' }, { status: 404 });
const tx = txs[0];

if (tx.session_id !== id) return NextResponse.json({ error: 'Transaction not found' }, { status: 404 });

const rounds = await sql`SELECT * FROM rounds WHERE id = ${tx.round_id}`;
if (rounds.length === 0 || rounds[0].status !== 'active') return NextResponse.json({ error: 'Round is not active' }, { status: 400 });

if (tx.partner_id !== playerId) return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
if (tx.status !== 'pending') return NextResponse.json({ error: 'Transaction no longer pending' }, { status: 400 });

Expand Down
1 change: 1 addition & 0 deletions tsconfig.tsbuildinfo

Large diffs are not rendered by default.