fix(ui) - dashboard info update
This commit is contained in:
parent
f38956592b
commit
b94bd834d3
2 changed files with 10 additions and 2 deletions
|
|
@ -215,9 +215,9 @@ export default class DashboardStore {
|
|||
|
||||
syncDashboardInfo(id: string, info: { name: string, description: string, isPublic: boolean, createdAt: number }) {
|
||||
if (this.selectedDashboard !== null) {
|
||||
this.selectedDashboard.update(info)
|
||||
this.selectedDashboard.updateInfo(info)
|
||||
const index = this.dashboards.findIndex((d) => d.dashboardId === id);
|
||||
Object.assign(this.dashboards[index], info)
|
||||
this.dashboards[index].updateInfo(info);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,14 @@ export default class Dashboard {
|
|||
this.validate()
|
||||
}
|
||||
|
||||
updateInfo(data: any) {
|
||||
runInAction(() => {
|
||||
this.name = data.name || this.name
|
||||
this.description = data.description || this.description
|
||||
this.isPublic = data.isPublic
|
||||
})
|
||||
}
|
||||
|
||||
toJson() {
|
||||
return {
|
||||
dashboardId: this.dashboardId,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue