mirror of
https://github.com/outline/outline.git
synced 2026-12-05 02:44:34 +03:00
fix: New documents should sort to the top of manually organized collection
This commit is contained in:
1 parent
ee57f1ccf5
commit
eeb7650941
1 file changed
+2
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user