diff --git a/backend/endpoints/platform.py b/backend/endpoints/platform.py index 284646981..480b6e86f 100644 --- a/backend/endpoints/platform.py +++ b/backend/endpoints/platform.py @@ -126,7 +126,7 @@ class DeletePlatformResponse(TypedDict): msg: str -@protected_route(router.delete, "/platforms/{fs_slug}", ["roms.write"]) +@protected_route(router.delete, "/platforms/{fs_slug}", ["platforms.write"]) def delete_platform( request: Request, fs_slug: str, delete_from_fs: bool = False ) -> DeletePlatformResponse: diff --git a/frontend/src/components/Dashboard/Recent.vue b/frontend/src/components/Dashboard/Recent.vue index 84d7ef808..f65c43eb0 100644 --- a/frontend/src/components/Dashboard/Recent.vue +++ b/frontend/src/components/Dashboard/Recent.vue @@ -1,7 +1,7 @@ @@ -51,7 +51,12 @@ onMounted(async () => { :lg="views[0]['size-lg']" :xl="views[0]['size-xl']" > - + diff --git a/frontend/src/components/Dialog/Platform/DeletePlatform.vue b/frontend/src/components/Dialog/Platform/DeletePlatform.vue index 25d7e6b2d..7b4c50a7c 100644 --- a/frontend/src/components/Dialog/Platform/DeletePlatform.vue +++ b/frontend/src/components/Dialog/Platform/DeletePlatform.vue @@ -4,11 +4,11 @@ import { useRouter } from "vue-router"; import type { Emitter } from "mitt"; import type { Events } from "@/types/emitter"; import api from "@/services/api"; -import storePlatforms from "@/stores/platforms"; +import storePlatforms, { type Platform } from "@/stores/platforms"; const router = useRouter(); const platformsStore = storePlatforms(); -const platform = ref(); +const platform = ref(null); const show = ref(false); const emitter = inject>("emitter"); emitter?.on("showDeletePlatformDialog", (platformToDelete) => { @@ -18,6 +18,8 @@ emitter?.on("showDeletePlatformDialog", (platformToDelete) => { const deleteFromFs = ref(false); async function deletePlatform() { + if (!platform.value) return; + show.value = false; await api .deletePlatform({ diff --git a/frontend/src/components/Gallery/AppBar/AdminMenu.vue b/frontend/src/components/Gallery/AppBar/AdminMenu.vue index 86765a242..df7847656 100644 --- a/frontend/src/components/Gallery/AppBar/AdminMenu.vue +++ b/frontend/src/components/Gallery/AppBar/AdminMenu.vue @@ -1,12 +1,7 @@