fix: replace $fetch with getCategories for fetching categories in report creation
This commit is contained in:
@@ -9,13 +9,14 @@ useHead({ title: 'Crea Segnalazione - Visione' })
|
||||
|
||||
const router = useRouter()
|
||||
const { createReport, uploadMedia } = useReports()
|
||||
const { getCategories } = useAdmin()
|
||||
const { user } = useAuth()
|
||||
|
||||
// Fetch categories
|
||||
const { data: categoriesData } = await useAsyncData('categories', () =>
|
||||
$fetch('/api/v1/admin/categories')
|
||||
getCategories()
|
||||
)
|
||||
const categories = computed(() => (categoriesData.value as any)?.categories || [])
|
||||
const categories = computed(() => categoriesData.value?.categories || [])
|
||||
|
||||
// 👇 Manteniamo una sola dichiarazione per queste variabili
|
||||
const isLoading = ref(false)
|
||||
|
||||
Reference in New Issue
Block a user