ปรับ children

This commit is contained in:
Bright 2024-05-15 18:02:16 +07:00
parent 1a017dcd76
commit 4fa11d2aea
5 changed files with 75 additions and 29 deletions

View file

@ -33,7 +33,7 @@ export class ProfileFamilyCoupleController extends Controller {
@Example({
status: 200,
message: "สำเร็จ",
result: {
result: [{
id: "6207ae29-05ef-4abb-9a37-a887265d671e",
couple: true,
couplePrefix: "string",
@ -45,7 +45,7 @@ export class ProfileFamilyCoupleController extends Controller {
coupleLive: true,
relationship: "string",
profileId: "1526d9d3-d8b1-43ab-81b5-a84dfbe99201",
},
}],
})
public async getFamilyCouple(@Path() profileId: string) {
const profile = await this.profileRepo.findOne({
@ -55,7 +55,7 @@ export class ProfileFamilyCoupleController extends Controller {
if (!profile) {
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
}
const familyCouple = await this.ProfileFamilyCouple.findOne({
const familyCouple = await this.ProfileFamilyCouple.find({
select: [
"id", "couple", "couplePrefix", "coupleFirstName", "coupleLastName", "coupleLastNameOld",
"coupleCareer", "coupleCitizenId", "coupleLive", "relationship", "profileId",