recursive navigation for merge and mangadetail

add remove functionality
This commit is contained in:
2025-10-15 00:33:20 +02:00
parent bd0e0b26c1
commit 4177a23fb8
3 changed files with 15 additions and 11 deletions

View File

@@ -52,15 +52,17 @@
@click="unlinkMetadataFetcher(row.original)"
>Unlink</UButton
>
<UButton v-else :to="`/manga/${mangaId}/linkMetadata/${row.original}`" class="float-right px-4">Link</UButton>
<UButton v-else :to="`/manga/${mangaId}/linkMetadata/${row.original}?return=${path}`" class="float-right px-4"
>Link</UButton
>
</template>
</UTable>
</UCard>
</div>
</div>
<template #actions>
<UButton trailing-icon="i-lucide-merge" :to="`/manga/${manga?.key}/merge/`" color="secondary">Merge</UButton>
<UButton variant="soft" color="warning" icon="i-lucide-trash" />
<UButton trailing-icon="i-lucide-merge" :to="`/manga/${manga?.key}/merge?return=${path}`" color="secondary">Merge</UButton>
<UButton variant="soft" color="warning" icon="i-lucide-trash" @click="remove" />
</template>
</MangaDetailPage>
</template>
@@ -71,6 +73,7 @@ const { $api } = useNuxtApp();
const route = useRoute();
const mangaId = route.params.mangaId as string;
const backUrl = route.query.return as string | undefined;
const path = route.fullPath;
const flashDownloading = route.query.download;
@@ -107,6 +110,12 @@ const unlinkMetadataFetcher = async (metadataFetcherName: string) => {
await refreshNuxtData(FetchKeys.Metadata.Manga(mangaId));
};
const remove = async () => {
await $api('/v2/Manga/{MangaId}', { method: 'DELETE', path: { MangaId: mangaId } });
await refreshNuxtData(FetchKeys.Manga.All);
navigateTo('/');
};
useHead({ title: 'Manga' });
</script>