biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -2,23 +2,27 @@ import { defineStore } from 'pinia'
|
|||
|
||||
export const useOAuthTokensStore = defineStore('oauthTokens', {
|
||||
state: () => ({
|
||||
tokens: []
|
||||
tokens: [],
|
||||
}),
|
||||
actions: {
|
||||
fetchTokens () {
|
||||
window.vuex.state.api.backendInteractor.fetchOAuthTokens().then((tokens) => {
|
||||
this.swapTokens(tokens)
|
||||
})
|
||||
fetchTokens() {
|
||||
window.vuex.state.api.backendInteractor
|
||||
.fetchOAuthTokens()
|
||||
.then((tokens) => {
|
||||
this.swapTokens(tokens)
|
||||
})
|
||||
},
|
||||
revokeToken (id) {
|
||||
window.vuex.state.api.backendInteractor.revokeOAuthToken({ id }).then((response) => {
|
||||
if (response.status === 201) {
|
||||
this.swapTokens(this.tokens.filter(token => token.id !== id))
|
||||
}
|
||||
})
|
||||
revokeToken(id) {
|
||||
window.vuex.state.api.backendInteractor
|
||||
.revokeOAuthToken({ id })
|
||||
.then((response) => {
|
||||
if (response.status === 201) {
|
||||
this.swapTokens(this.tokens.filter((token) => token.id !== id))
|
||||
}
|
||||
})
|
||||
},
|
||||
swapTokens (tokens) {
|
||||
swapTokens(tokens) {
|
||||
this.tokens = tokens
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue