refactor: user can no longer fetch activities manually
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {activityApi, characterApi} from "@/mammon";
|
||||
import {characterApi} from "@/mammon";
|
||||
import {defineStore} from "pinia";
|
||||
import {ref} from "vue";
|
||||
import {CharacterResponse} from "@/generated/mammon";
|
||||
@@ -18,11 +18,9 @@ export const useCharactersStore = defineStore('characters', () => {
|
||||
return character;
|
||||
}
|
||||
|
||||
const reloadActivities = (characterId: number): Promise<void> => activityApi.fetchNewActivitiesForCharacter(characterId) as Promise<void>;
|
||||
|
||||
const refresh = () => characterApi.findAllCharacters().then(response => characters.value = response.data);
|
||||
|
||||
refresh();
|
||||
|
||||
return {characters, findById, reloadActivities};
|
||||
return {characters, findById};
|
||||
})
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import {CharacterLabel, useCharactersStore} from "@/characters";
|
||||
import {useAuthStore} from "@/auth";
|
||||
import {ArrowPathIcon} from '@heroicons/vue/24/outline';
|
||||
|
||||
const charactersStore = useCharactersStore()
|
||||
const authStore = useAuthStore()
|
||||
@@ -17,7 +16,6 @@ const addCharacter = () => authStore.addCharacter();
|
||||
</div>
|
||||
<div v-for="character in charactersStore.characters" :key="character.characterId" class="flex items-center mb-2">
|
||||
<CharacterLabel class="grow" :character="character" />
|
||||
<button class="btn-icon" @click="charactersStore.reloadActivities(character.characterId)"><ArrowPathIcon /></button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user