fix(v2): use correct route name when navigating after delete

Deleting a platform or collection in the v2 UI showed "Failed to
delete: unknown error" even though the deletion succeeded. The success
handler navigated to a non-existent route name ("platforms" /
"collections"), and Vue Router threw on the unknown name, which the
catch block surfaced as a generic error.

Navigate to the real index routes (PLATFORMS_INDEX / COLLECTIONS_INDEX)
instead.

Fixes #3598

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Cv77VUJgPe1H7ipSRitjpH
This commit is contained in:
Claude
2026-06-25 23:54:44 +00:00
parent cfff9f30e1
commit 302288e62f
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ import { RDivider, type RTabNavItem } from "@v2/lib";
import { computed, nextTick, onMounted, ref, watch } from "vue";
import { useI18n } from "vue-i18n";
import { onBeforeRouteUpdate, useRoute, useRouter } from "vue-router";
import { ROUTES } from "@/plugins/router";
import collectionApi from "@/services/api/collection";
import storeAuth from "@/stores/auth";
import storeCollections, {
@@ -267,7 +268,7 @@ async function onDelete() {
snackbar.success(`Collection "${c.name}" deleted`, {
icon: "mdi-check-bold",
});
router.push({ name: "collections" });
router.push({ name: ROUTES.COLLECTIONS_INDEX });
} catch (err) {
const e = err as {
response?: { data?: { msg?: string; detail?: string } };
+1 -1
View File
@@ -372,7 +372,7 @@ async function onDelete() {
snackbar.success(`Platform "${p.display_name}" deleted`, {
icon: "mdi-check-bold",
});
router.push({ name: "platforms" });
router.push({ name: ROUTES.PLATFORMS_INDEX });
} catch (err) {
const e = err as {
response?: { data?: { msg?: string } };