Decode JSON in backend not frontend and make component path a full path (also in backend)

This commit is contained in:
chfhtw
2026-04-16 09:51:32 +02:00
parent cfe6e3c805
commit 24c8a1c501
2 changed files with 10 additions and 3 deletions
@@ -55,6 +55,16 @@ class Board extends FHCAPI_Controller
$data = $this->getDataOrTerminateWithError($result);
$data = array_map(function ($dashboard) {
$tmpSetups = json_decode($dashboard->widgetSetup);
$tmpSetups = array_map(function ($widget) {
$widget->setup->file = absoluteJsImportUrl($widget->setup->file);
return $widget;
}, $tmpSetups);
$dashboard->widgetSetup = $tmpSetups;
return $dashboard;
}, $data);
$this->terminateWithSuccess($data);
}
-3
View File
@@ -87,9 +87,6 @@ export default {
.call(ApiDashboardBoard.list())
.then(result => {
this.dashboards = result.data;
for (const dashboard of this.dashboards) {
dashboard.widgetSetup = JSON.parse(dashboard.widgetSetup);
}
})
.catch(this.$fhcAlert.handleSystemError);
},