fix: metadata update errors

This commit is contained in:
DecDuck
2025-05-29 17:36:52 +10:00
parent ea90a7f086
commit c5f8b44537

View File

@ -569,6 +569,8 @@ const descriptionSaving = ref<number>(0);
let savingTimeout: undefined | NodeJS.Timeout; let savingTimeout: undefined | NodeJS.Timeout;
type PatchGameBody = Partial<Game>;
watch(descriptionHTML, (_v) => { watch(descriptionHTML, (_v) => {
console.log(game.value.mDescription); console.log(game.value.mDescription);
descriptionSaving.value = 1; descriptionSaving.value = 1;
@ -581,7 +583,7 @@ watch(descriptionHTML, (_v) => {
body: { body: {
id: gameId, id: gameId,
mDescription: game.value.mDescription, mDescription: game.value.mDescription,
}, } satisfies PatchGameBody,
}); });
descriptionSaving.value = 0; descriptionSaving.value = 0;
} catch (e) { } catch (e) {
@ -625,8 +627,8 @@ async function updateBannerImage(id: string) {
method: "PATCH", method: "PATCH",
body: { body: {
id: gameId, id: gameId,
mBannerId: id, mBannerObjectId: id,
}, } satisfies PatchGameBody,
}); });
game.value.mBannerObjectId = mBannerObjectId; game.value.mBannerObjectId = mBannerObjectId;
} catch (e) { } catch (e) {
@ -652,8 +654,8 @@ async function updateCoverImage(id: string) {
method: "PATCH", method: "PATCH",
body: { body: {
id: gameId, id: gameId,
mCoverId: id, mCoverObjectId: id,
}, } satisfies PatchGameBody,
}); });
game.value.mCoverObjectId = mCoverObjectId; game.value.mCoverObjectId = mCoverObjectId;
} catch (e) { } catch (e) {
@ -727,8 +729,8 @@ async function updateImageCarousel() {
method: "PATCH", method: "PATCH",
body: { body: {
id: gameId, id: gameId,
mImageCarousel: game.value.mImageCarouselObjectIds, mImageCarouselObjectIds: game.value.mImageCarouselObjectIds,
}, } satisfies PatchGameBody,
}); });
} catch (e) { } catch (e) {
createModal( createModal(