18 lines
392 B
TypeScript
18 lines
392 B
TypeScript
import { defineStore } from 'pinia'
|
|
import { ref } from 'vue'
|
|
import { type Status, statusesList } from '@/api/status.api.ts'
|
|
|
|
export const useStatusStore = defineStore('counter', () => {
|
|
const statuses = ref<Status[]>()
|
|
|
|
async function list() {
|
|
statuses.value = await statusesList()
|
|
}
|
|
|
|
function reset() {
|
|
statuses.value = undefined
|
|
}
|
|
|
|
return { statuses, list, reset }
|
|
})
|