Add widget to preset bugfix

This commit is contained in:
cgfhtw
2022-11-03 11:24:29 +01:00
parent e1addbfe04
commit 3764df6102
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ class Config extends Auth_Controller
$this->terminateWithJsonError('preset could not be saved');
}
$this->outputJsonSuccess(array('msg' => 'preset successfully stored.'));
$this->outputJsonSuccess(array('msg' => 'preset successfully stored.', 'data' => $preset_decoded));
}
public function removeWidgetFromPreset()
@@ -27,6 +27,7 @@ export default {
widgetAdd(section_name, widget) {
this.$refs.widgetpicker.getWidget().then(widget_id => {
widget.widget = widget_id;
delete widget.custom;
let loading = {...widget};
loading.loading = true;
this.sections.forEach(section => {
@@ -41,6 +42,7 @@ export default {
}).then(result => {
let newId = Object.keys(result.data.retval.data.widgets[section_name]).pop();
widget.id = newId;
widget.custom = 1;
this.sections.forEach(section => {
if (section.name == section_name) {
section.widgets.splice(section.widgets.indexOf(loading),1);