chore: make server functions async
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
kolaente 2021-12-14 21:31:25 +01:00
parent c49fd997d2
commit e2fc5e940d
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 16 deletions

View File

@ -96,23 +96,18 @@ service.getAll()
})
const newToken = ref(null)
const createToken = () => {
service.create({})
.then(r => {
tokens.value.push(r)
newToken.value = r
})
const createToken = async () => {
const r = await service.create({})
tokens.value.push(r)
newToken.value = r
}
const deleteToken = (token: CaldavTokenModel) => {
service.delete(token)
// @ts-ignore
.then(r => {
success(r)
// @ts-ignore
const i = tokens.value.findIndex(v => v.id === token.id)
// @ts-ignore
tokens.value.splice(i, 1)
})
const deleteToken = async (token: CaldavTokenModel) => {
const r = await service.delete(token)
success(r)
// @ts-ignore
const i = tokens.value.findIndex(v => v.id === token.id)
// @ts-ignore
tokens.value.splice(i, 1)
}
</script>