fix: when no family data response with null
This commit is contained in:
parent
61b166cabc
commit
0b46df7d64
1 changed files with 8 additions and 4 deletions
|
|
@ -101,10 +101,14 @@ export class ProfileFamilyHistoryController extends Controller {
|
|||
order: { createdAt: "DESC" },
|
||||
where: { profileId },
|
||||
});
|
||||
return new HttpSuccess({
|
||||
...family[0],
|
||||
children,
|
||||
});
|
||||
return new HttpSuccess(
|
||||
family.length > 0
|
||||
? {
|
||||
...family[0],
|
||||
children,
|
||||
}
|
||||
: null,
|
||||
);
|
||||
}
|
||||
|
||||
@Get("history/{profileId}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue