Merge branch 'develop' of github.com:Frappet/bma-ehr-organization into develop

This commit is contained in:
kittapath 2024-11-27 13:54:01 +07:00
commit b6f72e879c
2 changed files with 9 additions and 7 deletions

View file

@ -328,9 +328,15 @@ export class EmployeePositionController extends Controller {
case "positionLevel":
if (!isNaN(Number(keyword))) {
const findEmpLevels: EmployeePosLevel[] = await this.employeePosLevelRepository.find({
where: { posLevelName: Number(keyword) },
});
let findEmpLevels;
if(Number(keyword) === 0) {
findEmpLevels = await this.employeePosLevelRepository.find();
}
else {
findEmpLevels = await this.employeePosLevelRepository.find({
where: { posLevelName: Number(keyword) },
});
}
findData = await this.employeePosDictRepository.find({
where: { posLevelId: In(findEmpLevels.map((x) => x.id)) },
relations: ["posType", "posLevel"],

View file

@ -672,10 +672,6 @@ export class PositionController extends Controller {
case "positionExecutive":
const findExecutive: PosExecutive[] = await this.posExecutiveRepository.find({
where: { posExecutiveName: Like(`%${keyword}%`) },
order: {
// posExecutiveName: "ASC"
posExecutivePriority: "ASC"
},
select: ["id"],
});
findPosDict = await this.posDictRepository.find({