Automatically deploy the lowest available lobby with exact ID preview

This commit is contained in:
2026-09-17 15:59:29 -04:00
parent ae173517b6
commit e8e7332365
5 changed files with 39 additions and 47 deletions
+4 -4
View File
@@ -43,11 +43,11 @@ export async function POST({ request }: { request: Request }) {
gameMode?: string;
mapSlug?: string;
plutoKey?: string;
lobby?: number;
expectedName?: string;
};
if (!body || typeof body.gameMode !== 'string' || typeof body.mapSlug !== 'string' || (body.plutoKey !== undefined && typeof body.plutoKey !== 'string') || (body.lobby !== undefined && typeof body.lobby !== 'number')) {
if (!body || typeof body.gameMode !== 'string' || typeof body.mapSlug !== 'string' || (body.plutoKey !== undefined && typeof body.plutoKey !== 'string') || (body.expectedName !== undefined && typeof body.expectedName !== 'string')) {
return json(
{ ok: false, error: 'gameMode and mapSlug are required strings; plutoKey and lobby are optional', kind: 'bad-request' },
{ ok: false, error: 'gameMode and mapSlug are required strings; plutoKey and expectedName are optional strings', kind: 'bad-request' },
{ status: 400 }
);
}
@@ -55,7 +55,7 @@ export async function POST({ request }: { request: Request }) {
gameMode: body.gameMode as GameMode,
mapSlug: body.mapSlug,
plutoKey: body.plutoKey,
lobby: body.lobby,
expectedName: body.expectedName,
createdBy: 'ui'
});
if (!result.ok) {