mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-10-15 09:50:48 +02:00
Fix useFetch misuse (use $fetch instead)
This commit is contained in:
@@ -16,12 +16,14 @@
|
||||
<script setup lang="ts">
|
||||
import type { components } from '#open-fetch-schemas/api';
|
||||
type FileLibrary = components['schemas']['FileLibrary'];
|
||||
const { $api } = useNuxtApp();
|
||||
|
||||
const { data: fileLibraries } = await useApi('/v2/FileLibrary', { key: FetchKeys.FileLibraries });
|
||||
|
||||
const busy = ref(false);
|
||||
const deleteLibrary = async (library: FileLibrary) => {
|
||||
busy.value = true;
|
||||
await useApi('/v2/FileLibrary/{FileLibraryId}', { path: { FileLibraryId: library.key }, method: 'DELETE' });
|
||||
await $api('/v2/FileLibrary/{FileLibraryId}', { path: { FileLibraryId: library.key }, method: 'DELETE' });
|
||||
await refreshNuxtData(FetchKeys.FileLibraries);
|
||||
busy.value = false;
|
||||
};
|
||||
|
Reference in New Issue
Block a user