Skip to content

Commit

Permalink
Merge pull request #874 from rommapp/hotfix-upload-image
Browse files Browse the repository at this point in the history
[HOTFIX] Uploading images for roms and users
  • Loading branch information
gantoine authored May 23, 2024
2 parents f5b5de2 + b5f731a commit baaf34e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/src/services/api/rom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ async function downloadRom({
}

export type UpdateRom = Rom & {
artwork?: File[];
artwork?: File;
};

async function updateRom({
Expand All @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/services/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function updateUser({
avatar,
...attrs
}: UserSchema & {
avatar?: File[];
avatar?: File;
password?: string;
}): Promise<{ data: UserSchema }> {
return api.put(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/types/emitter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { User } from "@/stores/users";

export type UserItem = User & {
password: string;
avatar?: File[];
avatar?: File;
};

export type SnackbarStatus = {
Expand Down

0 comments on commit baaf34e

Please sign in to comment.