Skip to content
Snippets Groups Projects
Commit 15df9577 authored by Angelina Filippova's avatar Angelina Filippova
Browse files

Fix wrapping cron tab settings before sending them to BE

parent 1ad4cc27
No related branches found
No related tags found
1 merge request!101Update configuring Oban.Cron setting
Pipeline #23499 passed
......@@ -59,12 +59,18 @@ export default {
return this.setting.suggestions.find(suggestion => suggestion[1] === worker)[0]
},
update(value, worker) {
const updatedValue = {
...this.$store.state.settings.settings[this.settingGroup.group][this.settingGroup.key][this.setting.key],
[worker]: value
}
const currentValue = this.$store.state.settings.settings[this.settingGroup.group][this.settingGroup.key][this.setting.key]
const updatedValue = { ...currentValue, [worker]: value }
const updatedValueWithType = Object.keys(currentValue).reduce((acc, key) => {
if (key === worker) {
return { ...acc, [key]: ['reversed_tuple', value] }
} else {
return { ...acc, [key]: ['reversed_tuple', currentValue[key]] }
}
}, {})
this.$store.dispatch('UpdateSettings',
{ group: this.settingGroup.group, key: this.settingGroup.key, input: this.setting.key, value: updatedValue, type: 'reversed_tuple' }
{ group: this.settingGroup.group, key: this.settingGroup.key, input: this.setting.key, value: updatedValueWithType, type: this.setting.type }
)
this.$store.dispatch('UpdateState',
{ group: this.settingGroup.group, key: this.settingGroup.key, input: this.setting.key, value: updatedValue }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment