diff --git a/src/controllers/EmployeePositionController.ts b/src/controllers/EmployeePositionController.ts index 6622f78f..632261e0 100644 --- a/src/controllers/EmployeePositionController.ts +++ b/src/controllers/EmployeePositionController.ts @@ -2485,6 +2485,7 @@ export class EmployeePositionController extends Controller { async listPosMasterHistory(@Path() id: string, @Request() request: RequestWithUser) { const posMasterHistory = await this.posMasterHistoryRepository.find({ where: { ancestorDNA: id }, + order: { createdAt: "DESC" }, }); return new HttpSuccess(posMasterHistory); diff --git a/src/controllers/EmployeeTempPositionController.ts b/src/controllers/EmployeeTempPositionController.ts index d4316e3c..5d304de0 100644 --- a/src/controllers/EmployeeTempPositionController.ts +++ b/src/controllers/EmployeeTempPositionController.ts @@ -2221,6 +2221,7 @@ export class EmployeeTempPositionController extends Controller { async listPosMasterHistory(@Path() id: string, @Request() request: RequestWithUser) { const posMasterHistory = await this.posMasterHistoryRepository.find({ where: { ancestorDNA: id }, + order: { createdAt: "DESC" }, }); return new HttpSuccess(posMasterHistory); diff --git a/src/controllers/PositionController.ts b/src/controllers/PositionController.ts index 997f5627..e8467d12 100644 --- a/src/controllers/PositionController.ts +++ b/src/controllers/PositionController.ts @@ -5636,6 +5636,7 @@ export class PositionController extends Controller { async listPosMasterHistory(@Path() id: string, @Request() request: RequestWithUser) { const posMasterHistory = await this.posMasterHistoryRepository.find({ where: { ancestorDNA: id }, + order: { createdAt: "DESC" }, }); return new HttpSuccess(posMasterHistory);