Add Prettier and ESLint tooling (Refs #77)
This commit is contained in:
@@ -4,8 +4,12 @@ import { previewCreation } from '$lib/server/provisioning/index.js';
|
||||
export async function POST({ request }: { request: Request }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
if (!body || typeof body !== 'object' || Array.isArray(body)) throw new Error('Provide a launch selection.');
|
||||
if (body.blueprintId !== undefined) throw new Error('Collections use target counts. Use /api/deployment-collections/preview to preview only missing servers.');
|
||||
if (!body || typeof body !== 'object' || Array.isArray(body))
|
||||
throw new Error('Provide a launch selection.');
|
||||
if (body.blueprintId !== undefined)
|
||||
throw new Error(
|
||||
'Collections use target counts. Use /api/deployment-collections/preview to preview only missing servers.'
|
||||
);
|
||||
return json(previewCreation(body));
|
||||
} catch (err) {
|
||||
return json({ error: (err as Error).message }, { status: 400 });
|
||||
|
||||
Reference in New Issue
Block a user