Add multi-server blueprint collections and atomic launches

This commit is contained in:
2026-09-18 00:08:54 -04:00
parent 782c7c0bda
commit 989931a0f2
20 changed files with 868 additions and 50 deletions
+9 -1
View File
@@ -1,6 +1,14 @@
import { json } from '@sveltejs/kit';
import { deleteBlueprint } from '$lib/server/fleet/launch-recipes.js';
import { deleteBlueprint, updateBlueprint } from '$lib/server/fleet/launch-recipes.js';
export function DELETE({ params }: { params: { id: string } }) {
return deleteBlueprint(params.id) ? json({ ok: true }) : json({ error: 'Blueprint not found.' }, { status: 404 });
}
export async function PUT({ params, request }: { params: { id: string }; request: Request }) {
try {
const body = await request.json();
if (!body || typeof body !== 'object' || Array.isArray(body)) throw new Error('Provide a blueprint name and map selections.');
return json({ blueprint: updateBlueprint(params.id, body) });
} catch (err) { return json({ error: (err as Error).message }, { status: 400 }); }
}