mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
Decode JSON in backend not frontend and make component path a full path (also in backend)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user