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) {
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",