wip fix code edit
This commit is contained in:
parent
ddab876d8c
commit
2737342ba7
|
|
@ -87,7 +87,23 @@ export const code_edit: SAction["code"]["edit"] = async function (
|
|||
}
|
||||
}
|
||||
}
|
||||
}, "server");
|
||||
});
|
||||
|
||||
if (save_to === "comp" && comp_id) {
|
||||
db.component.update({
|
||||
where: { id: comp_id },
|
||||
data: {
|
||||
content_tree: root.toJSON(),
|
||||
},
|
||||
});
|
||||
} else if (page_id) {
|
||||
db.page.update({
|
||||
where: { id: page_id },
|
||||
data: {
|
||||
content_tree: root.toJSON(),
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (e: any) {
|
||||
return e.message.toString();
|
||||
}
|
||||
|
|
@ -109,6 +125,22 @@ export const code_edit: SAction["code"]["edit"] = async function (
|
|||
mprop.set("value", src);
|
||||
mprop.set("valueBuilt", res.code.substring(6));
|
||||
});
|
||||
|
||||
if (save_to === "comp" && comp_id) {
|
||||
db.component.update({
|
||||
where: { id: comp_id },
|
||||
data: {
|
||||
content_tree: root.toJSON(),
|
||||
},
|
||||
});
|
||||
} else if (page_id) {
|
||||
db.page.update({
|
||||
where: { id: page_id },
|
||||
data: {
|
||||
content_tree: root.toJSON(),
|
||||
},
|
||||
});
|
||||
}
|
||||
} catch (e: any) {
|
||||
return e.message.toString();
|
||||
}
|
||||
|
|
@ -151,6 +183,12 @@ export const code_edit: SAction["code"]["edit"] = async function (
|
|||
}
|
||||
}
|
||||
});
|
||||
await db.component.update({
|
||||
where: { id: comp_id },
|
||||
data: {
|
||||
content_tree: root.toJSON(),
|
||||
},
|
||||
});
|
||||
} catch (e: any) {
|
||||
return e.message.toString();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue