Fix locations details page + pass test

This commit is contained in:
2020-12-21 22:56:28 +01:00
parent 3a8c052d86
commit 16a0dc47da
2 changed files with 27 additions and 6 deletions

View File

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