feat: v0.8.0 — player-actions API: accept/dispatch/buy/sell/refuel endpoints (tick-first, full-snapshot responses), spawn coverage rule, test create-contract hook
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { acceptContract, performAction } from '@/lib/game/actions';
|
||||
|
||||
// POST /api/contracts/:id/accept (v0.8.0) — claim an open contract: status flips
|
||||
// open → accepted. 404 unknown id; 409 if the contract is not 'open' (accepted /
|
||||
// completed / expired). No body. On success returns the full state snapshot.
|
||||
|
||||
export async function POST(_req: Request, ctx: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await ctx.params;
|
||||
return performAction((inst) => acceptContract(inst, id));
|
||||
}
|
||||
Reference in New Issue
Block a user