Skip to content

Instantly share code, notes, and snippets.

View masweb's full-sized avatar
🎯
Focusing

Guillermo Valentín masweb

🎯
Focusing
View GitHub Profile
@masweb
masweb / fetch useApi
Last active February 18, 2023 22:26
#fetch
import { useApi } from '@/composables/useApi'
import type { iBMResp } from '@/Interfaces/interfaces'
const resp:iBMResp = await useApi('/eventmultimedias', {
method: 'POST',
body: formData,
})
if (resp.status === 'Success') {
pics = resp.data
loaded()
} else console.log('$fetch error', resp.status, resp.message)
@masweb
masweb / #fetch#javascript
Last active February 18, 2023 15:13
Fetch call
import {useFetch} from '@/composables/useFetch'
const {data, error} = useFetch('/thegreaturl/' + varr)
watch(data, () => {
if (data.value.status === 'Success') {
} else console.log('fetchError', data.value.message, error.value)
})