chad/client/shared/chad-api.ts
Никита Круглицкий 39e877bbe9
All checks were successful
Deploy / deploy (push) Successful in 47s
куча говна
2025-10-20 03:23:34 +06:00

17 lines
469 B
TypeScript

import { ToastEventBus } from 'primevue'
const instance = $fetch.create({
baseURL: process.env.API_BASE_URL || 'https://api.koptilnya.xyz/chad',
credentials: 'include',
onResponseError({ response }) {
if (!import.meta.client)
return
const message = response._data.error || 'Something went wrong'
ToastEventBus.emit('add', { severity: 'error', summary: 'Error', detail: message, closable: false, life: 3000 })
},
})
export default instance