fix: relation not included in select

This commit is contained in:
Methapon2001 2024-03-28 11:55:21 +07:00
parent 6fa61f6ae0
commit cabc83d189

View file

@ -72,22 +72,24 @@ export class ProfileAddressController extends Controller {
public async getProfileAddressHistory(@Path() addressId: string) { public async getProfileAddressHistory(@Path() addressId: string) {
const record = await this.profileAddressHistoryRepo.find({ const record = await this.profileAddressHistoryRepo.find({
where: { profileId: addressId }, where: { profileId: addressId },
relations: {
registrationProvince: true,
registrationDistrict: true,
registrationSubDistrict: true,
currentProvince: true,
currentDistrict: true,
currentSubDistrict: true,
},
select: [ select: [
"registrationAddress", "registrationAddress",
"registrationProvinceId", "registrationProvinceId",
"registrationProvince",
"registrationDistrictId", "registrationDistrictId",
"registrationDistrict",
"registrationSubDistrictId", "registrationSubDistrictId",
"registrationSubDistrict",
"registrationZipCode", "registrationZipCode",
"currentAddress", "currentAddress",
"currentProvinceId", "currentProvinceId",
"currentProvince",
"currentDistrictId", "currentDistrictId",
"currentDistrict",
"currentSubDistrictId", "currentSubDistrictId",
"currentSubDistrict",
"currentZipCode", "currentZipCode",
"createdFullName", "createdFullName",
"createdAt", "createdAt",