This commit is contained in:
AdisakKanthawilang 2024-11-19 14:34:33 +07:00
parent ef01602285
commit b456fe46ff
2 changed files with 11 additions and 1 deletions

View file

@ -1121,7 +1121,15 @@ export class PositionController extends Controller {
const positions = await this.positionRepository.find({ const positions = await this.positionRepository.find({
where: { posMasterId: posMaster.id }, where: { posMasterId: posMaster.id },
relations: ["posType", "posLevel", "posExecutive"], relations: ["posType", "posLevel", "posExecutive"],
order: { lastUpdatedAt: "ASC" }, // order: { lastUpdatedAt: "ASC" },
order: {
posType: {
posTypeRank: "ASC"
},
posLevel: {
posLevelRank: "ASC"
}
},
}); });
const formattedData = { const formattedData = {
id: posMaster.id, id: posMaster.id,

View file

@ -4310,6 +4310,8 @@ export class ProfileController extends Controller {
) )
.skip((requestBody.page - 1) * requestBody.pageSize) .skip((requestBody.page - 1) * requestBody.pageSize)
.take(requestBody.pageSize) .take(requestBody.pageSize)
.orderBy("posType.posTypeRank", "ASC")
.addOrderBy("posLevel.posLevelRank", "ASC")
.getManyAndCount(); .getManyAndCount();
const data = profiles.map((_data) => ({ const data = profiles.map((_data) => ({