From eeb7650941f4ac301b768a3aec7cbb610e0cf986 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 30 Jan 2021 00:18:56 -0800 Subject: [PATCH] fix: New documents should sort to the top of manually organized collection --- server/models/Document.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/models/Document.js b/server/models/Document.js index 71900e769..80014b402 100644 --- a/server/models/Document.js +++ b/server/models/Document.js @@ -490,7 +490,7 @@ Document.addHook("afterCreate", async (model) => { return; } - await collection.addDocumentToStructure(model); + await collection.addDocumentToStructure(model, 0); model.collection = collection; return model; @@ -579,7 +579,7 @@ Document.prototype.publish = async function (options) { if (this.publishedAt) return this.save(options); const collection = await Collection.findByPk(this.collectionId); - await collection.addDocumentToStructure(this); + await collection.addDocumentToStructure(this, 0); this.publishedAt = new Date(); await this.save(options);