Update nav tree after document update
This commit is contained in:
@@ -114,12 +114,19 @@ router.post('documents.update', auth(), async (ctx) => {
|
||||
|
||||
if (!document) throw httpErrors.BadRequest();
|
||||
|
||||
// Update document
|
||||
document.title = title;
|
||||
document.text = text;
|
||||
document.lastModifiedById = user.id;
|
||||
await document.save();
|
||||
await document.createRevision();
|
||||
|
||||
// Update
|
||||
const atlas = await Atlas.findById(document.atlasId);
|
||||
if (atlas.type === 'atlas') {
|
||||
await atlas.updateNavigationTree();
|
||||
}
|
||||
|
||||
ctx.body = {
|
||||
data: await presentDocument(document, true),
|
||||
};
|
||||
@@ -155,4 +162,4 @@ router.post('documents.delete', auth(), async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
export default router;
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user