Skip to content

Commit

Permalink
fix(core): Order collection.children by position
Browse files Browse the repository at this point in the history
Closes #1239
  • Loading branch information
michaelbromley committed Dec 2, 2021
1 parent f9bc532 commit f2def43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/service/services/collection.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f2def43

Please sign in to comment.