statuses unit tests
This commit is contained in:
parent
ed62403d96
commit
1396eeb71b
23 changed files with 860 additions and 742 deletions
|
|
@ -1,17 +1,34 @@
|
|||
import { defineStore } from 'pinia'
|
||||
|
||||
import { useOAuthStore } from 'src/stores/oauth.js'
|
||||
|
||||
import { fetchStatusHistory } from 'src/api/public.js'
|
||||
|
||||
export const useStatusHistoryStore = defineStore('statusHistory', {
|
||||
state: () => ({
|
||||
params: {},
|
||||
id: null,
|
||||
modalActivated: false,
|
||||
history: null,
|
||||
}),
|
||||
actions: {
|
||||
openStatusHistoryModal(params) {
|
||||
this.params = params
|
||||
this.modalActivated = true
|
||||
openModal(id) {
|
||||
this.fetchStatusHistory(id).then(() => {
|
||||
this.id = id
|
||||
this.modalActivated = true
|
||||
})
|
||||
},
|
||||
closeStatusHistoryModal() {
|
||||
closeModal() {
|
||||
this.id = null
|
||||
this.modalActivated = false
|
||||
this.history = null
|
||||
},
|
||||
fetchStatusHistory(id) {
|
||||
return fetchStatusHistory({
|
||||
id,
|
||||
credentials: useOAuthStore().token,
|
||||
}).then(({ data }) => {
|
||||
this.history = data
|
||||
})
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue