Fix useFetch misuse (use $fetch instead)

This commit is contained in:
2025-10-14 14:21:20 +02:00
parent 6a5bf947a1
commit a01dc430e6
8 changed files with 31 additions and 14 deletions

View File

@@ -20,6 +20,7 @@
const route = useRoute();
const mangaId = route.params.mangaId as string;
const mangaConnectorName = route.params.mangaConnectorName as string;
const { $api } = useNuxtApp();
const { data: manga } = await useApi('/v2/Manga/{MangaId}', { path: { MangaId: mangaId }, key: FetchKeys.Manga.Id(mangaId) });
const libraryId = ref(manga.value?.fileLibraryId);
@@ -31,7 +32,7 @@ const { data: mangaConnector } = await useApi('/v2/MangaConnector/{MangaConnecto
const loading = ref(false);
const onDownloadClick = async () => {
loading.value = true;
await useApi('/v2/Manga/{MangaId}/DownloadFrom/{MangaConnectorName}/{IsRequested}', {
await $api('/v2/Manga/{MangaId}/DownloadFrom/{MangaConnectorName}/{IsRequested}', {
method: 'PATCH',
path: { MangaId: mangaId, MangaConnectorName: mangaConnectorName, IsRequested: true },
});