fix: when no family data response with null

This commit is contained in:
Methapon2001 2024-03-20 17:52:54 +07:00
parent 61b166cabc
commit 0b46df7d64

View file

@ -101,10 +101,14 @@ export class ProfileFamilyHistoryController extends Controller {
order: { createdAt: "DESC" }, order: { createdAt: "DESC" },
where: { profileId }, where: { profileId },
}); });
return new HttpSuccess({ return new HttpSuccess(
...family[0], family.length > 0
children, ? {
}); ...family[0],
children,
}
: null,
);
} }
@Get("history/{profileId}") @Get("history/{profileId}")