Files
pages/theseus_gui/src/helpers/fetch.js
Geometrically ee61951698 Initial bug fixes (#127)
* Initial bug fixes

* fix compile error on non-mac

* Fix even more bugs

* Fix more

* fix more

* fix build

* fix build

* address review comments
2023-06-02 07:09:46 -07:00

12 lines
266 B
JavaScript

import { ofetch } from 'ofetch'
import { handleError } from '@/store/state.js'
export const useFetch = async (url, item) => {
try {
return await ofetch(url)
} catch (err) {
handleError({ message: `Error fetching ${item}` })
console.error(err)
}
}