Added store favourites
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
<div v-if="error">Une erreur est survenue : {{ error }}</div>
|
||||
<div>{{ celestial }}</div>
|
||||
</div>
|
||||
<button @click="toggleFav(celestial.id)">Favourite</button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<nest-loader />
|
||||
@@ -19,8 +18,6 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
|
||||
import store from "@/store";
|
||||
|
||||
// API
|
||||
import { fetchCelestial } from "@/api/le-systeme-solaire";
|
||||
// import { fetchWikipediaExcerpt } from "@/api/wikipedia";
|
||||
@@ -65,13 +62,6 @@ export default defineComponent({
|
||||
.then(() => {
|
||||
// fetchWikipediaExcerpt(celestial);
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
toggleFav: (celestialId: string) => {
|
||||
store.dispatch("toggleFav", celestialId);
|
||||
console.log(store.state.user.favourites);
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user