Merge pull request #1882 from SevanNerse/fix-akaunting-select

fixing typo and bug when group is true
This commit is contained in:
Cüneyt Şentürk 2021-02-23 01:55:14 +03:00 committed by GitHub
commit 909f4f663f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 12 deletions

View File

@ -294,12 +294,12 @@ export default {
}, },
created() { created() {
let created_option = (this.dynamicOptions) ? this.dynamicOptions : this.options; let created_options = (this.dynamicOptions) ? this.dynamicOptions : this.options;
if (this.group) { if (this.group) {
// Option set sort_option data // Option set sort_option data
if (!Array.isArray(created_options)) { if (!Array.isArray(created_options)) {
for (const [index, options] of Object.entries(created_option)) { for (const [index, options] of Object.entries(created_options)) {
let values = []; let values = [];
for (const [key, value] of Object.entries(options)) { for (const [key, value] of Object.entries(options)) {
@ -315,7 +315,7 @@ export default {
}); });
} }
} else { } else {
created_option.forEach(function (option, index) { created_options.forEach(function (option, index) {
if (typeof(option) == 'string') { if (typeof(option) == 'string') {
this.sort_options.push({ this.sort_options.push({
index: index, index: index,
@ -333,15 +333,15 @@ export default {
} }
} else { } else {
// Option set sort_option data // Option set sort_option data
if (!Array.isArray(created_option)) { if (!Array.isArray(created_options)) {
for (const [key, value] of Object.entries(created_option)) { for (const [key, value] of Object.entries(created_options)) {
this.sort_options.push({ this.sort_options.push({
key: key, key: key,
value: value value: value
}); });
} }
} else { } else {
created_option.forEach(function (option, index) { created_options.forEach(function (option, index) {
if (typeof(option) == 'string') { if (typeof(option) == 'string') {
this.sort_options.push({ this.sort_options.push({
index: index, index: index,

View File

@ -468,12 +468,12 @@ export default {
}, },
setSortOptions() { setSortOptions() {
let created_option = (this.dynamicOptions) ? this.dynamicOptions : this.options; let created_options = (this.dynamicOptions) ? this.dynamicOptions : this.options;
if (this.group) { if (this.group) {
// Option set sort_option data // Option set sort_option data
if (!Array.isArray(created_options)) { if (!Array.isArray(created_options)) {
for (const [index, options] of Object.entries(created_option)) { for (const [index, options] of Object.entries(created_options)) {
let values = []; let values = [];
for (const [key, value] of Object.entries(options)) { for (const [key, value] of Object.entries(options)) {
@ -489,7 +489,7 @@ export default {
}); });
} }
} else { } else {
created_option.forEach(function (option, index) { created_options.forEach(function (option, index) {
this.sort_options.push({ this.sort_options.push({
index: index, index: index,
key: option.id, key: option.id,
@ -499,15 +499,15 @@ export default {
} }
} else { } else {
// Option set sort_option data // Option set sort_option data
if (!Array.isArray(created_option)) { if (!Array.isArray(created_options)) {
for (const [key, value] of Object.entries(created_option)) { for (const [key, value] of Object.entries(created_options)) {
this.sort_options.push({ this.sort_options.push({
key: key, key: key,
value: value value: value
}); });
} }
} else { } else {
created_option.forEach(function (option, index) { created_options.forEach(function (option, index) {
this.sort_options.push({ this.sort_options.push({
index: index, index: index,
key: option.id, key: option.id,