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