รายการสมรรถนะ "สมรรถนะหลัก"
This commit is contained in:
parent
b7c0075f5a
commit
0b49e363b5
1 changed files with 27 additions and 0 deletions
|
|
@ -176,6 +176,33 @@ export class kpiCapacityController extends Controller {
|
|||
return new HttpSuccess(kpiCapacity.id);
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการสมรรถนะ "สมรรถนะหลัก"
|
||||
*
|
||||
* @summary รายละเอียดดรายการสมรรถนะ "สมรรถนะหลัก"
|
||||
*
|
||||
*/
|
||||
@Get("head")
|
||||
async GetKpiCapacityTypeHEAD() {
|
||||
const kpiCapacity = await this.kpiCapacityRepository.find({
|
||||
where: {
|
||||
type: In(["HEAD"]),
|
||||
kpiCapacityDetails: { level: "1" }
|
||||
},
|
||||
select: ["id", "name"],
|
||||
relations: ["kpiCapacityDetails"],
|
||||
});
|
||||
|
||||
const mapData = kpiCapacity.map((x) => ({
|
||||
id: x.id,
|
||||
name: x.name,
|
||||
level: x.kpiCapacityDetails.length > 0 ? x.kpiCapacityDetails[0].level : null,
|
||||
description: x.kpiCapacityDetails.length > 0 ? x.kpiCapacityDetails[0].description : null,
|
||||
}));
|
||||
|
||||
return new HttpSuccess(mapData);
|
||||
}
|
||||
|
||||
/**
|
||||
* API รายละเอียดรายการสมรรถนะ
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue