mirror of
https://github.com/rommapp/romm.git
synced 2026-06-29 15:25:46 +00:00
upload roms fixed
This commit is contained in:
@@ -42,7 +42,7 @@ def add_roms(
|
||||
UploadRomResponse: Standard message response
|
||||
"""
|
||||
|
||||
platform_fs_slug = db_rom_handler.get_platforms(platform_id).fs_slug
|
||||
platform_fs_slug = db_platform_handler.get_platforms(platform_id).fs_slug
|
||||
log.info(f"Uploading roms to {platform_fs_slug}")
|
||||
if roms is None:
|
||||
log.error("No roms were uploaded")
|
||||
|
||||
@@ -23,11 +23,11 @@ async function uploadRoms({
|
||||
let formData = new FormData();
|
||||
romsToUpload.forEach((rom) => formData.append("roms", rom));
|
||||
|
||||
return api.put("/roms", formData, {
|
||||
return api.post("/roms", formData, {
|
||||
headers: {
|
||||
"Content-Type": "multipart/form-data",
|
||||
},
|
||||
params: { platform_slug: platform },
|
||||
params: { platform_id: platform },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -4,18 +4,6 @@ import type { User } from "@/stores/users";
|
||||
|
||||
export const api_user = api;
|
||||
|
||||
async function fetchUsers(): Promise<{ data: UserSchema[] }> {
|
||||
return api.get("/users");
|
||||
}
|
||||
|
||||
async function fetchUser(user: User): Promise<{ data: UserSchema }> {
|
||||
return api.get(`/users/${user.id}`);
|
||||
}
|
||||
|
||||
async function fetchCurrentUser(): Promise<{ data: UserSchema | null }> {
|
||||
return api.get("/users/me");
|
||||
}
|
||||
|
||||
async function createUser({
|
||||
username,
|
||||
password,
|
||||
@@ -28,6 +16,18 @@ async function createUser({
|
||||
return api.post("/users", {}, { params: { username, password, role } });
|
||||
}
|
||||
|
||||
async function fetchUsers(): Promise<{ data: UserSchema[] }> {
|
||||
return api.get("/users");
|
||||
}
|
||||
|
||||
async function fetchUser(user: User): Promise<{ data: UserSchema }> {
|
||||
return api.get(`/users/${user.id}`);
|
||||
}
|
||||
|
||||
async function fetchCurrentUser(): Promise<{ data: UserSchema | null }> {
|
||||
return api.get("/users/me");
|
||||
}
|
||||
|
||||
async function updateUser({
|
||||
id,
|
||||
username,
|
||||
|
||||
Reference in New Issue
Block a user