Update DevelopmentController.ts

This commit is contained in:
AnandaTon 2024-05-21 18:17:47 +07:00
parent a428f59d9d
commit fe6c92674b

View file

@ -1661,14 +1661,13 @@ export class DevelopmentController extends Controller {
@Request() request: { user: Record<string, any> },
) {
const getDevelopment = await this.developmentHistoryRepository.find({
where: { developmentId: id, isDone: false, type: "OFFICER" },
where: { developmentId: id, isDone: false },
relations: ["development"],
});
await Promise.all(
getDevelopment.map(async (x) => {
const _data = Object.assign(new DevelopmentHistory(), x);
if (x.type === "OFFICER") {
if (x.type == "OFFICER") {
await new CallAPI()
.PostData(request, "org/profile/training", {
profileId: x.profileId,
@ -1690,7 +1689,10 @@ export class DevelopmentController extends Controller {
.catch((x) => {
_data.isDone = false;
});
} else if (x.type === "EMPLOYEE") {
} else if (x.type == "EMPLOYEE") {
console.log(
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
);
await new CallAPI()
.PostData(request, "org/profile-employee/training", {
profileEmployeeId: x.profileId,