Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX] Uploading images for roms and users #874

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -1,4 +1,4 @@
import type { MessageResponse, UserSchema } from "@/__generated__";

Check failure on line 1 in frontend/src/services/api/user.ts

View check run for this annotation

Trunk.io / Trunk Check

prettier

Incorrect formatting, autoformat by running 'trunk fmt'
import api from "@/services/api/index";
import type { User } from "@/stores/users";

Expand Down Expand Up @@ -33,7 +33,7 @@
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
Loading