diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index 3adbb36..1c1eaf5 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -309,6 +309,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -586,6 +587,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -704,6 +706,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1012,6 +1015,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1441,6 +1445,7 @@ export class SalaryPeriodController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1770,7 +1775,7 @@ export class SalaryPeriodController extends Controller { if (SalaryPeriod?.period == "SPECIAL") { const SalaryOrg = await this.salaryOrgRepository.find({ where: { salaryPeriodId: SalaryPeriod.id }, - relations: ["salaryProfiles"], + relations: { salaryProfiles: true }, }); const salaryProfile = SalaryOrg.find((x) => x.salaryProfiles.length > 0); if (salaryProfile) throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่สามารถลบได้"); diff --git a/src/controllers/SalaryPeriodEmployeeController.ts b/src/controllers/SalaryPeriodEmployeeController.ts index d9e929c..089918f 100644 --- a/src/controllers/SalaryPeriodEmployeeController.ts +++ b/src/controllers/SalaryPeriodEmployeeController.ts @@ -271,6 +271,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -720,6 +721,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -839,6 +841,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1322,6 +1325,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({ @@ -1976,6 +1980,7 @@ export class SalaryPeriodEmployeeController extends Controller { where: { id: _salaryProfile.salaryOrg.id, }, + relations: { salaryProfiles: true }, }); if (salaryOrg != null) { const amountFullType = await this.salaryProfileRepository.count({