history kpi

This commit is contained in:
AdisakKanthawilang 2024-05-08 17:54:53 +07:00
parent 46e23f619c
commit 36de3d9717
5 changed files with 118 additions and 124 deletions

View file

@ -551,4 +551,22 @@ export class kpiRoleController extends Controller {
}
return new HttpSuccess();
}
/**
* API
* @param id Guid, *Id
*/
@Get("history/{id}")
async GetHistory(@Path() id: string) {
const kpiRoleHistory = await this.kpiRoleHistoryRepository.find({
where: { kpiRoleId: id },
order:{
createdAt: "ASC"
}
});
if (!kpiRoleHistory) {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลประวัดิตัวชี้วัดตามตำแหน่งนี้");
}
return new HttpSuccess(kpiRoleHistory);
}
}