From 35b9ef659907c88887c714e5243c1840b563cdcb Mon Sep 17 00:00:00 2001 From: Rizky Date: Thu, 8 Feb 2024 08:18:08 +0700 Subject: [PATCH] wip fix --- app/srv/ws/sync/actions/code_edit.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/srv/ws/sync/actions/code_edit.ts b/app/srv/ws/sync/actions/code_edit.ts index 37b89604..c1a84d6e 100644 --- a/app/srv/ws/sync/actions/code_edit.ts +++ b/app/srv/ws/sync/actions/code_edit.ts @@ -91,14 +91,14 @@ export const code_edit: SAction["code"]["edit"] = async function ( }); if (save_to === "comp" && comp_id) { - _db.component.update({ + await _db.component.update({ where: { id: comp_id }, data: { content_tree: root.toJSON(), }, }); } else if (page_id && validate(page_id)) { - _db.page.update({ + await _db.page.update({ where: { id: page_id }, data: { content_tree: root.toJSON(), @@ -128,14 +128,14 @@ export const code_edit: SAction["code"]["edit"] = async function ( }); if (save_to === "comp" && comp_id) { - _db.component.update({ + await _db.component.update({ where: { id: comp_id }, data: { content_tree: root.toJSON(), }, }); } else if (page_id && validate(page_id)) { - _db.page.update({ + await _db.page.update({ where: { id: page_id }, data: { content_tree: root.toJSON(), @@ -189,6 +189,7 @@ export const code_edit: SAction["code"]["edit"] = async function ( } } }); + await _db.component.update({ where: { id: comp_id }, data: {