Fix locations details page + pass test
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user