game version re-ordering

This commit is contained in:
DecDuck
2024-10-14 20:34:23 +11:00
parent 8674ac7211
commit 329c74d3ce
18 changed files with 354 additions and 50 deletions

View File

@ -10,23 +10,24 @@ export default defineEventHandler(async (h3) => {
const platform = body.platform;
const startup = body.startup;
const setup = body.setup ?? "";
if (
!gameId ||
!versionName ||
!platform ||
!startup
)
const delta = body.delta ?? false;
if (!gameId || !versionName || !platform || (!delta && !startup))
throw createError({
statusCode: 400,
statusMessage:
"Missing id, version, platform, setup or startup from body",
});
const taskId = await libraryManager.importVersion(gameId, versionName, {
platform,
startup,
setup,
});
const taskId = await libraryManager.importVersion(
gameId,
versionName,
{
platform,
startup,
setup,
},
delta
);
if (!taskId)
throw createError({
statusCode: 400,