mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-06-22 04:11:32 +10:00
fix: not being able to edit game title
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
import type { Prisma } from "~/prisma/client";
|
||||||
import aclManager from "~/server/internal/acls";
|
import aclManager from "~/server/internal/acls";
|
||||||
import prisma from "~/server/internal/db/database";
|
import prisma from "~/server/internal/db/database";
|
||||||
import { handleFileUpload } from "~/server/internal/utils/handlefileupload";
|
import { handleFileUpload } from "~/server/internal/utils/handlefileupload";
|
||||||
@@ -27,25 +28,24 @@ export default defineEventHandler(async (h3) => {
|
|||||||
const description = options.description;
|
const description = options.description;
|
||||||
const gameId = options.id;
|
const gameId = options.id;
|
||||||
|
|
||||||
if (!id || !name || !description) {
|
const changes: Prisma.GameUpdateInput = {
|
||||||
dump();
|
mName: name,
|
||||||
|
mShortDescription: description,
|
||||||
|
};
|
||||||
|
|
||||||
throw createError({
|
// handle if user uploaded new icon
|
||||||
statusCode: 400,
|
if (id) {
|
||||||
statusMessage: "Nothing has changed",
|
changes.mIconObjectId = id;
|
||||||
});
|
await pull();
|
||||||
|
} else {
|
||||||
|
dump();
|
||||||
}
|
}
|
||||||
|
|
||||||
await pull();
|
|
||||||
const newObject = await prisma.game.update({
|
const newObject = await prisma.game.update({
|
||||||
where: {
|
where: {
|
||||||
id: gameId,
|
id: gameId,
|
||||||
},
|
},
|
||||||
data: {
|
data: changes,
|
||||||
mIconObjectId: id,
|
|
||||||
mName: name,
|
|
||||||
mShortDescription: description,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return newObject;
|
return newObject;
|
||||||
|
|||||||
@@ -306,8 +306,6 @@ export class IGDBProvider implements MetadataProvider {
|
|||||||
results.push(await this._getGenreInternal(genre));
|
results.push(await this._getGenreInternal(genre));
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(results);
|
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user