13 lines
675 B
TypeScript
13 lines
675 B
TypeScript
import { performAction, repairPlane } from '@/lib/game/actions';
|
|
|
|
// POST /api/planes/:planeId/repair (v0.39.0, ISS-069) — no body. Restores a worn-out plane to
|
|
// full health for the flat REPAIR_COST: it is grounded in "repairing" status until 3 sim days
|
|
// pass, when the engine's tick flips it back to "available". A full-health repair is a free
|
|
// no-op (cost 0). 404 unknown id; 409 plane not grounded or insufficient funds. On success
|
|
// returns the full state snapshot.
|
|
|
|
export async function POST(_req: Request, ctx: { params: Promise<{ planeId: string }> }) {
|
|
const { planeId } = await ctx.params;
|
|
return performAction((inst) => repairPlane(inst, planeId));
|
|
}
|