Fix date handling in admin APIs
This commit is contained in:
parent
fe364c6e11
commit
fbbc479032
3 changed files with 3 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ export async function GET(request: Request) {
|
|||
children: children.map((c: any) => ({
|
||||
id: c.id,
|
||||
name: c.name,
|
||||
birthDate: c.birth_date?.toISOString(),
|
||||
birthDate: c.birth_date ? new Date(c.birth_date).toISOString() : null,
|
||||
familyId: c.family_id,
|
||||
familyName: c.family_name,
|
||||
age: c.age || "N/A",
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ export async function GET(request: Request) {
|
|||
tier: f.tier || "free",
|
||||
maxChildren: f.max_children || 1,
|
||||
maxMembers: f.max_members || 2,
|
||||
createdAt: f.created_at?.toISOString(),
|
||||
createdAt: f.created_at ? new Date(f.created_at).toISOString() : null,
|
||||
userCount: Number(f.user_count) || 0,
|
||||
childCount: Number(f.child_count) || 0,
|
||||
})),
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export async function GET(request: Request) {
|
|||
name: u.name,
|
||||
familyId: u.family_id,
|
||||
familyName: u.family_name,
|
||||
createdAt: u.created_at?.toISOString(),
|
||||
createdAt: u.created_at ? new Date(u.created_at).toISOString() : null,
|
||||
})),
|
||||
});
|
||||
} catch (error) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue