completed game importing; partial work on version importing

This commit is contained in:
DecDuck
2024-10-11 00:37:08 +11:00
parent 718f5ba514
commit a7c33e7d43
42 changed files with 1499 additions and 281 deletions

View File

@ -24,7 +24,9 @@ export default defineEventHandler(async (h3) => {
const userId = uuidv4();
const profilePictureObject = await h3.context.objects.createFromSource(
const profilePictureId = uuidv4();
await h3.context.objects.createFromSource(
profilePictureId,
() =>
$fetch<Readable>("https://avatars.githubusercontent.com/u/64579723?v=4", {
responseType: "stream",
@ -32,18 +34,12 @@ export default defineEventHandler(async (h3) => {
{},
[`anonymous:read`, `${userId}:write`]
);
if (!profilePictureObject)
throw createError({
statusCode: 500,
statusMessage: "Unable to import profile picture",
});
const user = await prisma.user.create({
data: {
username,
displayName: "DecDuck",
email: "",
profilePicture: profilePictureObject,
profilePicture: profilePictureId,
admin: true,
},
});