refactor: user can no longer fetch activities manually

This commit is contained in:
Sophie-Gaëlle CALLOCH
2026-07-07 17:02:14 +02:00
parent da7a729321
commit e8e7c4f642
2 changed files with 2 additions and 6 deletions
+2 -4
View File
@@ -1,4 +1,4 @@
import {activityApi, characterApi} from "@/mammon"; import {characterApi} from "@/mammon";
import {defineStore} from "pinia"; import {defineStore} from "pinia";
import {ref} from "vue"; import {ref} from "vue";
import {CharacterResponse} from "@/generated/mammon"; import {CharacterResponse} from "@/generated/mammon";
@@ -18,11 +18,9 @@ export const useCharactersStore = defineStore('characters', () => {
return character; return character;
} }
const reloadActivities = (characterId: number): Promise<void> => activityApi.fetchNewActivitiesForCharacter(characterId) as Promise<void>;
const refresh = () => characterApi.findAllCharacters().then(response => characters.value = response.data); const refresh = () => characterApi.findAllCharacters().then(response => characters.value = response.data);
refresh(); refresh();
return {characters, findById, reloadActivities}; return {characters, findById};
}) })
-2
View File
@@ -2,7 +2,6 @@
import {CharacterLabel, useCharactersStore} from "@/characters"; import {CharacterLabel, useCharactersStore} from "@/characters";
import {useAuthStore} from "@/auth"; import {useAuthStore} from "@/auth";
import {ArrowPathIcon} from '@heroicons/vue/24/outline';
const charactersStore = useCharactersStore() const charactersStore = useCharactersStore()
const authStore = useAuthStore() const authStore = useAuthStore()
@@ -17,7 +16,6 @@ const addCharacter = () => authStore.addCharacter();
</div> </div>
<div v-for="character in charactersStore.characters" :key="character.characterId" class="flex items-center mb-2"> <div v-for="character in charactersStore.characters" :key="character.characterId" class="flex items-center mb-2">
<CharacterLabel class="grow" :character="character" /> <CharacterLabel class="grow" :character="character" />
<button class="btn-icon" @click="charactersStore.reloadActivities(character.characterId)"><ArrowPathIcon /></button>
</div> </div>
</div> </div>
</template> </template>