فهرست منبع

fix(core): Order collection.children by position

Closes #1239
Michael Bromley 4 سال پیش
والد
کامیت
f2def437da
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  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 getChildren = async (id: ID, _descendants: Collection[] = [], depth = 1) => {
             const children = await this.connection
             const children = await this.connection
                 .getRepository(ctx, Collection)
                 .getRepository(ctx, Collection)
-                .find({ where: { parent: { id } } });
+                .find({ where: { parent: { id } }, order: { position: 'ASC' } });
             for (const child of children) {
             for (const child of children) {
                 _descendants.push(child);
                 _descendants.push(child);
                 if (depth < maxDepth) {
                 if (depth < maxDepth) {