Fix useAsync

This commit is contained in:
2021-08-17 16:22:21 +02:00
parent adb052d1de
commit ea2a007c9a
17 changed files with 102 additions and 108 deletions

View File

@@ -123,23 +123,19 @@ export default defineComponent({
const getDate = ref(new Date().getFullYear())
const hiring_message = ref("")
useAsync(async () => {
const hiring_message = useAsync(async () => {
const request = await $axios.get('/api/informations', {
headers: {
'Authorization': `Bearer ${process.env.API_TOKEN}`
}
})
if (request.status === 200) {
hiring_message.value = request.data.informations.translation.code
return request.data.informations.translation.code
} else {
app.error({statusCode: 500})
$sentry.captureEvent(request.data)
}
})
const store = useStore<State>()
const route = computed(() => store.state.route)
}, 'hiring_message')
return {
getDate,