mirror of
https://github.com/rommapp/romm.git
synced 2026-02-18 23:42:07 +01:00
Merge pull request #874 from rommapp/hotfix-upload-image
[HOTFIX] Uploading images for roms and users
This commit is contained in:
@@ -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 },
|
||||
|
||||
@@ -33,7 +33,7 @@ async function updateUser({
|
||||
avatar,
|
||||
...attrs
|
||||
}: UserSchema & {
|
||||
avatar?: File[];
|
||||
avatar?: File;
|
||||
password?: string;
|
||||
}): Promise<{ data: UserSchema }> {
|
||||
return api.put(
|
||||
|
||||
2
frontend/src/types/emitter.d.ts
vendored
2
frontend/src/types/emitter.d.ts
vendored
@@ -5,7 +5,7 @@ import type { User } from "@/stores/users";
|
||||
|
||||
export type UserItem = User & {
|
||||
password: string;
|
||||
avatar?: File[];
|
||||
avatar?: File;
|
||||
};
|
||||
|
||||
export type SnackbarStatus = {
|
||||
|
||||
Reference in New Issue
Block a user