Hi there i am trying to fetch data from api and trying to display it but it is giving error please guide me
import { ref, onMounted } from “vue”
const dashboard = ref(null)
onMounted(async () => {
const res = await fetch(‘/api/method/library_management.api.dashboard.get_dashboard_data’, {
method: ‘GET’,
})
const data = await res.json()
dashboard.value = data.message
})
This is an error