mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 08:12:40 +10:00
completed game importing; partial work on version importing
This commit is contained in:
@ -1,17 +1,25 @@
|
||||
import clientHandler from "~/server/internal/clients/handler";
|
||||
import { parsePlatform } from "~/server/internal/utils/parseplatform";
|
||||
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const body = await readBody(h3);
|
||||
|
||||
const name = body.name;
|
||||
const platform = body.platform;
|
||||
const platformRaw = body.platform;
|
||||
|
||||
if (!name || !platform)
|
||||
if (!name || !platformRaw)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Missing name or platform in body",
|
||||
});
|
||||
|
||||
const platform = parsePlatform(platformRaw);
|
||||
if (!platform)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Invalid or unsupported platform",
|
||||
});
|
||||
|
||||
const clientId = await clientHandler.initiate({ name, platform });
|
||||
|
||||
return `/client/${clientId}/callback`;
|
||||
|
||||
Reference in New Issue
Block a user