แก้ type date

This commit is contained in:
Kittapath 2024-05-09 12:09:59 +07:00
parent 940a6171ca
commit 1f44c7b418
7 changed files with 32 additions and 20 deletions

View file

@ -87,6 +87,8 @@ export class KpiUserPlannedController extends Controller {
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูล");
}
kpiUserPlanned.startDate = requestBody.startDate == undefined ? null : requestBody.startDate;
kpiUserPlanned.endDate = requestBody.endDate == undefined ? null : requestBody.endDate;
kpiUserPlanned.createdUserId = request.user.sub;
kpiUserPlanned.createdFullName = request.user.name;
kpiUserPlanned.lastUpdateUserId = request.user.sub;
@ -147,6 +149,8 @@ export class KpiUserPlannedController extends Controller {
// kpiUserPlanned.achievement5 = request.user.achievement5;
this.kpiUserPlannedRepository.merge(kpiUserPlanned, requestBody);
kpiUserPlanned.startDate = requestBody.startDate == undefined ? null : requestBody.startDate;
kpiUserPlanned.endDate = requestBody.endDate == undefined ? null : requestBody.endDate;
await this.kpiUserPlannedRepository.save(kpiUserPlanned);
return new HttpSuccess(kpiUserPlanned.id);
}