Browse Source

fix(core): Order collection.children by position

Closes #1239
Michael Bromley 4 years ago
parent
commit
f2def437da
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core/src/service/services/collection.service.ts

+ 1 - 1
packages/core/src/service/services/collection.service.ts

@@ -294,7 +294,7 @@ export class CollectionService implements OnModuleInit {
         const getChildren = async (id: ID, _descendants: Collection[] = [], depth = 1) => {
             const children = await this.connection
                 .getRepository(ctx, Collection)
-                .find({ where: { parent: { id } } });
+                .find({ where: { parent: { id } }, order: { position: 'ASC' } });
             for (const child of children) {
                 _descendants.push(child);
                 if (depth < maxDepth) {