LocationsAdminPage data table

This commit is contained in:
2024-10-26 23:52:38 +02:00
parent 57819f5a2f
commit f8e1a191b3
5 changed files with 148 additions and 72 deletions

View File

@@ -21,7 +21,9 @@ export const useLocationStore = defineStore("locationStore", {
cities: ref<Array<CityModel>>([]),
/** Request to server sent, waiting for data response */
fetchInProgress: ref(false)
fetchInProgress: ref(false),
showEditLocation: ref(false)
}),
actions: {
@@ -75,6 +77,21 @@ export const useLocationStore = defineStore("locationStore", {
.then(result => {
this.topLocations = result.data
})
},
newLocation() {
this.location = new LocationDetailsApiModel()
this.showEditLocation = true
},
editLocation(item: LocationApiModel) {
this.location = item
this.showEditLocation = true
},
async deleteLocation(item: LocationApiModel) {
// todo
}
},
})