From 31f2732ae400e5597f9f5e1fbfd4f60717397651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Sun, 1 Aug 2021 21:00:26 +0300 Subject: [PATCH] Akaunting select vue component enhancement --- .../assets/js/components/AkauntingSelect.vue | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 8ed00f0d3..fe7a0b600 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -384,13 +384,13 @@ export default { for (const [key, value] of Object.entries(options)) { values.push({ - key: key, + key: key.toString(), value: value }); } this.sorted_options.push({ - key: index, + key: index.toString(), value: values }); } @@ -405,7 +405,7 @@ export default { } else { this.sorted_options.push({ index: index, - key: option.id, + key: option.id.toString(), value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name }); } @@ -416,7 +416,7 @@ export default { if (!Array.isArray(created_options)) { for (const [key, value] of Object.entries(created_options)) { this.sorted_options.push({ - key: key, + key: key.toString(), value: value }); } @@ -431,7 +431,7 @@ export default { } else { this.sorted_options.push({ index: index, - key: option.id, + key: option.id.toString(), value: (option.title) ? option.title : (option.display_name) ? option.display_name : option.name }); } @@ -654,6 +654,7 @@ export default { } }) .then(response => { + this.loading = false; this.form.loading = false; if (response.data.success) { @@ -675,10 +676,14 @@ export default { this.add_new.html = ''; this.add_new_html = null; + response.data.data.mark_new = true; + this.$emit('new', response.data.data); this.change(); + this.$emit('visible-change', event); + let documentClasses = document.body.classList; documentClasses.remove("modal-open");