Merge pull request #874 from rommapp/hotfix-upload-image

[HOTFIX] Uploading images for roms and users
This commit is contained in:
Georges-Antoine Assi
2024-05-23 13:33:31 -04:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -125,7 +125,7 @@ async function downloadRom({
}
export type UpdateRom = Rom & {
artwork?: File[];
artwork?: File;
};
async function updateRom({
@@ -144,7 +144,7 @@ async function updateRom({
formData.append("file_name", rom.file_name);
formData.append("summary", rom.summary || "");
formData.append("url_cover", rom.url_cover || "");
if (rom.artwork) formData.append("artwork", rom.artwork[0]);
if (rom.artwork) formData.append("artwork", rom.artwork);
return api.put(`/roms/${rom.id}`, formData, {
params: { rename_as_igdb: renameAsIGDB, remove_cover: removeCover },

View File

@@ -33,7 +33,7 @@ async function updateUser({
avatar,
...attrs
}: UserSchema & {
avatar?: File[];
avatar?: File;
password?: string;
}): Promise<{ data: UserSchema }> {
return api.put(

View File

@@ -5,7 +5,7 @@ import type { User } from "@/stores/users";
export type UserItem = User & {
password: string;
avatar?: File[];
avatar?: File;
};
export type SnackbarStatus = {