Browse Source

Remove unnecessary lines

pull/1222/head
Hironsan 4 years ago
parent
commit
6764d7f179
1 changed files with 16 additions and 19 deletions
  1. 35
      frontend/pages/projects/_id/labels/index.vue

35
frontend/pages/projects/_id/labels/index.vue

@ -123,14 +123,28 @@ export default Vue.extend({
async create(item: LabelDTO) { async create(item: LabelDTO) {
await this.$services.label.create(this.projectId, item) await this.$services.label.create(this.projectId, item)
this.list()
this.dialogCreate = false
}, },
async update(item: LabelDTO) { async update(item: LabelDTO) {
await this.$services.label.update(this.projectId, item) await this.$services.label.update(this.projectId, item)
},
save() {
if (this.editedIndex > -1) {
this.update(this.editedItem)
} else {
this.create(this.editedItem)
}
this.list() this.list()
this.close()
},
close() {
this.dialogCreate = false this.dialogCreate = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
}, },
async remove() { async remove() {
@ -167,23 +181,6 @@ export default Vue.extend({
this.editedIndex = this.items.indexOf(item) this.editedIndex = this.items.indexOf(item)
this.editedItem = Object.assign({}, item) this.editedItem = Object.assign({}, item)
this.dialogCreate = true this.dialogCreate = true
},
close() {
this.dialogCreate = false
this.$nextTick(() => {
this.editedItem = Object.assign({}, this.defaultItem)
this.editedIndex = -1
})
},
save() {
if (this.editedIndex > -1) {
this.update(this.editedItem)
} else {
this.create(this.editedItem)
}
this.close()
} }
}, },

Loading…
Cancel
Save