mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-24 00:42:51 +10:00
fix: editing game image metadata in admin panel
This commit is contained in:
@@ -10,7 +10,8 @@
|
|||||||
class="flex flex-col lg:flex-row lg:justify-between items-start lg:items-center gap-2"
|
class="flex flex-col lg:flex-row lg:justify-between items-start lg:items-center gap-2"
|
||||||
>
|
>
|
||||||
<div class="inline-flex items-center gap-4">
|
<div class="inline-flex items-center gap-4">
|
||||||
<img :src="useObject(game.mIconObjectId)" class="size-20" />
|
<!-- cover image -->
|
||||||
|
<img :src="coreMetadataIconUrl" class="size-20" />
|
||||||
<div>
|
<div>
|
||||||
<h1 class="text-5xl font-bold font-display text-zinc-100">
|
<h1 class="text-5xl font-bold font-display text-zinc-100">
|
||||||
{{ game.mName }}
|
{{ game.mName }}
|
||||||
@@ -285,7 +286,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<UploadFileDialog
|
<UploadFileDialog
|
||||||
@@ -626,7 +626,7 @@ async function updateBannerImage(id: string) {
|
|||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
body: {
|
body: {
|
||||||
id: gameId,
|
id: gameId,
|
||||||
mBannerId: id,
|
mBannerObjectId: id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
game.value.mBannerObjectId = mBannerObjectId;
|
game.value.mBannerObjectId = mBannerObjectId;
|
||||||
@@ -653,10 +653,11 @@ async function updateCoverImage(id: string) {
|
|||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
body: {
|
body: {
|
||||||
id: gameId,
|
id: gameId,
|
||||||
mCoverId: id,
|
mCoverObjectId: id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
game.value.mCoverObjectId = mCoverObjectId;
|
game.value.mCoverObjectId = mCoverObjectId;
|
||||||
|
coreMetadataIconUrl.value = useObject(mCoverObjectId);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
createModal(
|
createModal(
|
||||||
ModalType.Notification,
|
ModalType.Notification,
|
||||||
@@ -708,8 +709,6 @@ async function uploadAfterImageUpload(result: Game) {
|
|||||||
game.value.mImageLibraryObjectIds = result.mImageLibraryObjectIds;
|
game.value.mImageLibraryObjectIds = result.mImageLibraryObjectIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function addImageToCarousel(id: string) {
|
function addImageToCarousel(id: string) {
|
||||||
showAddCarouselModal.value = false;
|
showAddCarouselModal.value = false;
|
||||||
game.value.mImageCarouselObjectIds.push(id);
|
game.value.mImageCarouselObjectIds.push(id);
|
||||||
@@ -730,7 +729,7 @@ async function updateImageCarousel() {
|
|||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
body: {
|
body: {
|
||||||
id: gameId,
|
id: gameId,
|
||||||
mImageCarousel: game.value.mImageCarouselObjectIds,
|
mImageCarouselObjectIds: game.value.mImageCarouselObjectIds,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|||||||
@@ -16,9 +16,7 @@ export default defineEventHandler<{
|
|||||||
|
|
||||||
const body = DeleteGameImage(await readBody(h3));
|
const body = DeleteGameImage(await readBody(h3));
|
||||||
if (body instanceof type.errors) {
|
if (body instanceof type.errors) {
|
||||||
// hover out.summary to see validation errors
|
console.error(h3.path, body.summary);
|
||||||
console.error(body.summary);
|
|
||||||
|
|
||||||
throw createError({
|
throw createError({
|
||||||
statusCode: 400,
|
statusCode: 400,
|
||||||
statusMessage: body.summary,
|
statusMessage: body.summary,
|
||||||
|
|||||||
Reference in New Issue
Block a user