use new /place/all api

This commit is contained in:
lesion 2022-06-01 14:08:13 +02:00
parent a7704526f9
commit fb4279a108
No known key found for this signature in database
GPG key ID: 352918250B012177

View file

@ -41,18 +41,21 @@
template(v-slot:item.actions='{item}') template(v-slot:item.actions='{item}')
v-btn(@click='editPlace(item)' color='primary' icon) v-btn(@click='editPlace(item)' color='primary' icon)
v-icon(v-text='mdiPencil') v-icon(v-text='mdiPencil')
nuxt-link(:to='`/p/${item.name}`')
v-icon(v-text='mdiEye')
</template> </template>
<script> <script>
import { mapState, mapActions } from 'vuex' import { mdiPencil, mdiChevronLeft, mdiChevronRight, mdiMagnify, mdiEye } from '@mdi/js'
import { mdiPencil, mdiChevronLeft, mdiChevronRight, mdiMagnify } from '@mdi/js'
export default { export default {
data () { data () {
return { return {
mdiPencil, mdiChevronRight, mdiChevronLeft, mdiMagnify, mdiPencil, mdiChevronRight, mdiChevronLeft, mdiMagnify, mdiEye,
loading: false, loading: false,
dialog: false, dialog: false,
valid: false, valid: false,
places: [],
search: '', search: '',
place: { name: '', address: '', id: null }, place: { name: '', address: '', id: null },
headers: [ headers: [
@ -62,9 +65,10 @@ export default {
] ]
} }
}, },
computed: mapState(['places']), async fetch () {
this.places = await this.$axios.$get('/place/all')
},
methods: { methods: {
...mapActions(['updateMeta']),
editPlace (item) { editPlace (item) {
this.place.name = item.name this.place.name = item.name
this.place.address = item.address this.place.address = item.address