From bd002135961d068e9877b6644f0ad49f82459d99 Mon Sep 17 00:00:00 2001 From: moss <> Date: Tue, 25 Mar 2025 10:32:06 +0700 Subject: [PATCH] =?UTF-8?q?sort=20=E0=B8=A2=E0=B8=B8=E0=B8=97=E0=B8=A8?= =?UTF-8?q?=E0=B8=B2=E0=B8=AA=E0=B8=95=E0=B8=A3=E0=B9=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/StrategyController.ts | 33 ++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) 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) {