diff --git a/src/controllers/StrategyController.ts b/src/controllers/StrategyController.ts index ce1cbd2..a00f3cf 100644 --- a/src/controllers/StrategyController.ts +++ b/src/controllers/StrategyController.ts @@ -43,7 +43,16 @@ export class StrategyController extends Controller { "strategyChild2s.strategyChild3s.strategyChild4s", "strategyChild2s.strategyChild3s.strategyChild4s.strategyChild5s", ], - order: { createdAt: "ASC" }, + order: { + createdAt: "ASC", + strategyChild2s: { + createdAt: "ASC", + strategyChild3s: { + createdAt: "ASC", + strategyChild4s: { createdAt: "ASC", strategyChild5s: { createdAt: "ASC" } }, + }, + }, + }, }); const formattedData = listStrategyChild1.map((item) => ({ @@ -100,7 +109,16 @@ export class StrategyController extends Controller { "strategyChild2s.strategyChild3s.strategyChild4s", "strategyChild2s.strategyChild3s.strategyChild4s.strategyChild5s", ], - order: { createdAt: "ASC" }, + order: { + createdAt: "ASC", + strategyChild2s: { + createdAt: "ASC", + strategyChild3s: { + createdAt: "ASC", + strategyChild4s: { createdAt: "ASC", strategyChild5s: { createdAt: "ASC" } }, + }, + }, + }, }); // if (!listStrategyChild1 || listStrategyChild1.length === 0) { @@ -151,7 +169,16 @@ export class StrategyController extends Controller { "strategyChild2s.strategyChild3s.strategyChild4s", "strategyChild2s.strategyChild3s.strategyChild4s.strategyChild5s", ], - order: { createdAt: "ASC" }, + order: { + createdAt: "ASC", + strategyChild2s: { + createdAt: "ASC", + strategyChild3s: { + createdAt: "ASC", + strategyChild4s: { createdAt: "ASC", strategyChild5s: { createdAt: "ASC" } }, + }, + }, + }, }); // if (!listStrategyChild1 || listStrategyChild1.length === 0) {