mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
refactor: update resource save
This commit is contained in:
@@ -63,8 +63,10 @@ export const dashboardStore = defineStore('dashboard', {
|
||||
},
|
||||
updateDashboardInfo(params: any) {
|
||||
Object.keys(params).forEach((key: string) => {
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
this.dashboardInfo[key] = params[key]
|
||||
if (params[key]) {
|
||||
// @ts-expect-error eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
this.dashboardInfo[key] = params[key]
|
||||
}
|
||||
})
|
||||
},
|
||||
setCanvasViewInfo(params: any) {
|
||||
|
||||
@@ -62,7 +62,7 @@ export const saveDashboardResource = (params: any, callBack: Function) => {
|
||||
canvas_view_info: JSON.stringify(canvasViewInfo.value),
|
||||
}
|
||||
dashboardApi.create_canvas(requestParams).then((res: any) => {
|
||||
dashboardStore.updateDashboardInfo({ id: res.id, dataState: 'ready' })
|
||||
dashboardStore.updateDashboardInfo({ id: res.id, name: params.name, dataState: 'ready' })
|
||||
callBack(res)
|
||||
})
|
||||
} else if (params.opt === 'newFolder') {
|
||||
|
||||
Reference in New Issue
Block a user