character endpoint
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import {characterControllerApi} from "@/mammon";
|
||||
import {defineStore} from "pinia";
|
||||
import {ref} from "vue";
|
||||
import {CharacterResponse} from "@/generated/mammon";
|
||||
|
||||
export type Character = CharacterResponse
|
||||
|
||||
export const useCharactersStore = defineStore('characters', () => {
|
||||
const characters = ref<Character[]>([]);
|
||||
|
||||
const refresh = () => characterControllerApi.getCharacters().then(response => characters.value = response.data);
|
||||
|
||||
refresh();
|
||||
|
||||
return {characters, refresh};
|
||||
})
|
||||
Reference in New Issue
Block a user