Merge branch 'develop' of github.com:Frappet/bma-ehr-salary into develop
This commit is contained in:
commit
01355ddfef
1 changed files with 16 additions and 1 deletions
|
|
@ -247,6 +247,7 @@ export class SalaryController extends Controller {
|
|||
})
|
||||
async GetSalaryById(@Path() id: string) {
|
||||
const salary = await this.salaryRepository.findOne({
|
||||
relations: ["posType_", "posLevel_"],
|
||||
where: { id: id },
|
||||
select: [
|
||||
"name",
|
||||
|
|
@ -260,10 +261,24 @@ export class SalaryController extends Controller {
|
|||
"details",
|
||||
],
|
||||
});
|
||||
|
||||
const formattedData = {
|
||||
name: salary?.name,
|
||||
isSpecial: salary?.isSpecial,
|
||||
posTypeId: salary?.posTypeId,
|
||||
posTypeName: salary?.posType_.posTypeName,
|
||||
posLevelId: salary?.posLevelId,
|
||||
posLevelName: salary?.posLevel_.posLevelName,
|
||||
isActive: salary?.isActive,
|
||||
date: salary?.date,
|
||||
startDate: salary?.startDate,
|
||||
endDate: salary?.endDate,
|
||||
details: salary?.details,
|
||||
};
|
||||
if (!salary) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลผังเงินเดือนนี้");
|
||||
}
|
||||
return new HttpSuccess(salary);
|
||||
return new HttpSuccess(formattedData);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue