Skip to content

Commit 3050f74

Browse files
committed
1 parent 37b66dd commit 3050f74

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/main/malewicz/src/components/ObjectsTablePanel.vue

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ export default {
131131
completeUri() {
132132
return this.$store.getters.getUri
133133
},
134+
types() {
135+
return this.$store.getters.getTypes
136+
},
134137
message: {
135138
get () {
136139
return this.$store.getters.getPageNumber
@@ -150,6 +153,30 @@ export default {
150153
},
151154
watch: {
152155
completeUri: {
156+
handler(newVal, oldVal) {
157+
if (this.$store.getters.getTypes.length === 0) {
158+
return
159+
}
160+
this.meta = this.$store.getters.getTypes.find( v => { return v.name === this.$store.getters.getUri.type } )
161+
this.items = []
162+
this.isLoading = true
163+
this.$http.get(this.$store.getters.preparedUri).then(
164+
response => {
165+
this.items = response.body
166+
if (this.items.length >= 15 && this.message === this.getPageCount()) {
167+
this.increasePageCount()
168+
}
169+
this.isLoading = false
170+
}, response => {
171+
this.$notify({ group: 'foo', type: 'error', title: 'Server error', text: response })
172+
this.isLoading = false
173+
}
174+
)
175+
176+
},
177+
deep: true,
178+
},
179+
types: {
153180
handler(newVal, oldVal) {
154181
this.meta = this.$store.getters.getTypes.find( v => { return v.name === this.$store.getters.getUri.type } )
155182
this.items = []

0 commit comments

Comments
 (0)