Fix people details page + pass test

This commit is contained in:
2020-12-21 22:53:04 +01:00
parent c3bb17f863
commit 3a8c052d86
3 changed files with 30 additions and 7 deletions

View File

@@ -5,7 +5,7 @@
</template>
<script>
import { mapState } from "vuex";
import { mapGetters } from "vuex";
export default {
name: "Person",
@@ -21,10 +21,13 @@ export default {
return uuid.test(params.id);
},
async asyncData({ params, store }) {
await store.dispatch("getPerson", params.id);
if (!store.state.people.person.id !== params.id)
await store.dispatch("people/getPerson", params.id);
},
computed: {
...mapState(["person"])
...mapGetters({
person: "people/person"
})
}
};
</script>