chore: make server functions async
This commit is contained in:
parent
0299ed32f3
commit
f042651986
1 changed files with 11 additions and 16 deletions
|
@ -96,23 +96,18 @@ service.getAll()
|
||||||
})
|
})
|
||||||
|
|
||||||
const newToken = ref(null)
|
const newToken = ref(null)
|
||||||
const createToken = () => {
|
const createToken = async () => {
|
||||||
service.create({})
|
const r = await service.create({})
|
||||||
.then(r => {
|
tokens.value.push(r)
|
||||||
tokens.value.push(r)
|
newToken.value = r
|
||||||
newToken.value = r
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteToken = (token: CaldavTokenModel) => {
|
const deleteToken = async (token: CaldavTokenModel) => {
|
||||||
service.delete(token)
|
const r = await service.delete(token)
|
||||||
// @ts-ignore
|
success(r)
|
||||||
.then(r => {
|
// @ts-ignore
|
||||||
success(r)
|
const i = tokens.value.findIndex(v => v.id === token.id)
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
const i = tokens.value.findIndex(v => v.id === token.id)
|
tokens.value.splice(i, 1)
|
||||||
// @ts-ignore
|
|
||||||
tokens.value.splice(i, 1)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue