fix bug
This commit is contained in:
parent
8b81afe00d
commit
0f76e8d3d9
1 changed files with 4 additions and 3 deletions
|
|
@ -150,7 +150,7 @@ export class SalaryPeriodController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขอเงินเดือนผู้ใช้งานนี้ในระบบ");
|
||||
}
|
||||
|
||||
// await this.salaryProfileRepository.remove(salaryProfile);
|
||||
await this.salaryProfileRepository.remove(salaryProfile);
|
||||
|
||||
// หาจำนวน Quota คงเหลือ
|
||||
if (salaryProfile.salaryOrg.snapshot == "SNAP1") {
|
||||
|
|
@ -195,7 +195,7 @@ export class SalaryPeriodController extends Controller {
|
|||
@Post("change/amount")
|
||||
async changeAmount(@Body() body: { profileId: string; amount: number }) {
|
||||
const salaryProfile = await this.salaryProfileRepository.findOne({
|
||||
relations: ["salaryOrg"],
|
||||
relations: ["salaryOrg","salaryOrg.salaryPeriod"],
|
||||
where: { id: body.profileId },
|
||||
});
|
||||
if (!salaryProfile) {
|
||||
|
|
@ -285,7 +285,7 @@ export class SalaryPeriodController extends Controller {
|
|||
}
|
||||
|
||||
await this.salaryProfileRepository.save(salaryProfile);
|
||||
|
||||
|
||||
// หาจำนวน Quota คงเหลือ
|
||||
if (salaryProfile.salaryOrg.snapshot == "SNAP1") {
|
||||
if(salaryProfile.salaryOrg.salaryPeriod.period == "APR"){
|
||||
|
|
@ -334,6 +334,7 @@ export class SalaryPeriodController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลการขอเงินเดือนผู้ใช้งานนี้ในระบบ");
|
||||
}
|
||||
const salaryOrg = await this.salaryOrgRepository.findOne({
|
||||
relations: ["salaryPeriod"],
|
||||
where: { id: body.groupId },
|
||||
});
|
||||
if (!salaryOrg) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue