diff --git a/src/controllers/ProfileFamilyHistoryController.ts b/src/controllers/ProfileFamilyHistoryController.ts index 29424f1f..6d696560 100644 --- a/src/controllers/ProfileFamilyHistoryController.ts +++ b/src/controllers/ProfileFamilyHistoryController.ts @@ -16,8 +16,6 @@ import { AppDataSource } from "../database/data-source"; import { CreateChildren, CreateProfileFamily, - ProfileChildren, - ProfileChildrenHistory, ProfileFamilyHistory, UpdateProfileFamily, } from "../entities/ProfileFamily"; @@ -26,6 +24,8 @@ import HttpStatus from "../interfaces/http-status"; import HttpError from "../interfaces/http-error"; import { RequestWithUser } from "../middlewares/user"; import { Profile } from "../entities/Profile"; +import { ProfileChildren } from "../entities/ProfileChildren"; +import { ProfileChildrenHistory } from "../entities/ProfileChildrenHistory"; @Route("api/v1/org/profile/family") @Tags("ProfileFamilyHistory") @@ -228,7 +228,7 @@ export class ProfileFamilyHistoryController extends Controller { ...v, children: await this.childrenHistoryRepo.find({ order: { createdAt: "ASC" }, - where: { profileFamilyHistoryId: v.id }, + // where: { profileFamilyHistoryId: v.id }, }), })), ); @@ -340,7 +340,7 @@ export class ProfileFamilyHistoryController extends Controller { return await this.childrenHistoryRepo.save( this.childrenHistoryRepo.create({ ...v, - profileFamilyHistoryId: familyRecord.id, + // profileFamilyHistoryId: familyRecord.id, profileChildrenId: v.id, id: undefined, }), diff --git a/src/controllers/ProfileFamilyHistoryEmployeeController.ts b/src/controllers/ProfileFamilyHistoryEmployeeController.ts index 98c1f0b3..ce34730d 100644 --- a/src/controllers/ProfileFamilyHistoryEmployeeController.ts +++ b/src/controllers/ProfileFamilyHistoryEmployeeController.ts @@ -15,10 +15,7 @@ import { import { AppDataSource } from "../database/data-source"; import { CreateChildren, - CreateProfileFamily, CreateProfileFamilyEmployee, - ProfileChildren, - ProfileChildrenHistory, ProfileFamilyHistory, UpdateProfileFamily, } from "../entities/ProfileFamily"; @@ -26,8 +23,9 @@ import HttpSuccess from "../interfaces/http-success"; import HttpStatus from "../interfaces/http-status"; import HttpError from "../interfaces/http-error"; import { RequestWithUser } from "../middlewares/user"; -import { Profile } from "../entities/Profile"; import { ProfileEmployee } from "../entities/ProfileEmployee"; +import { ProfileChildren } from "../entities/ProfileChildren"; +import { ProfileChildrenHistory } from "../entities/ProfileChildrenHistory"; @Route("api/v1/org/profile-employee/family") @Tags("ProfileFamilyHistoryEmployee") @@ -230,7 +228,7 @@ export class ProfileFamilyHistoryEmployeeController extends Controller { ...v, children: await this.childrenHistoryRepo.find({ order: { createdAt: "ASC" }, - where: { profileFamilyHistoryId: v.id }, + // where: { profileFamilyHistoryId: v.id }, }), })), ); @@ -342,7 +340,7 @@ export class ProfileFamilyHistoryEmployeeController extends Controller { return await this.childrenHistoryRepo.save( this.childrenHistoryRepo.create({ ...v, - profileFamilyHistoryId: familyRecord.id, + // profileFamilyHistoryId: familyRecord.id, profileChildrenId: v.id, id: undefined, }), @@ -361,7 +359,7 @@ export class ProfileFamilyHistoryEmployeeController extends Controller { if (result.affected == undefined || result.affected <= 0) { throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล"); } - + return new HttpSuccess(); } }