From cabc83d18924d329fd4818d377c2b7096e78e4b7 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Thu, 28 Mar 2024 11:55:21 +0700 Subject: [PATCH] fix: relation not included in select --- src/controllers/ProfileAddressController.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/controllers/ProfileAddressController.ts b/src/controllers/ProfileAddressController.ts index e0907264..fc9ff880 100644 --- a/src/controllers/ProfileAddressController.ts +++ b/src/controllers/ProfileAddressController.ts @@ -72,22 +72,24 @@ export class ProfileAddressController extends Controller { public async getProfileAddressHistory(@Path() addressId: string) { const record = await this.profileAddressHistoryRepo.find({ where: { profileId: addressId }, + relations: { + registrationProvince: true, + registrationDistrict: true, + registrationSubDistrict: true, + currentProvince: true, + currentDistrict: true, + currentSubDistrict: true, + }, select: [ "registrationAddress", "registrationProvinceId", - "registrationProvince", "registrationDistrictId", - "registrationDistrict", "registrationSubDistrictId", - "registrationSubDistrict", "registrationZipCode", "currentAddress", "currentProvinceId", - "currentProvince", "currentDistrictId", - "currentDistrict", "currentSubDistrictId", - "currentSubDistrict", "currentZipCode", "createdFullName", "createdAt",