diff --git a/src/app/api/today/route.ts b/src/app/api/today/route.ts index 29f2e7b..8d8630d 100644 --- a/src/app/api/today/route.ts +++ b/src/app/api/today/route.ts @@ -71,7 +71,7 @@ export const GET = withAuth(async (_request, user, pb) => { } // Try to fetch today's DailyLog for biometrics - // Sort by created DESC to get the most recent record if multiple exist + // Sort by date DESC to get the most recent record if multiple exist let biometrics = { ...DEFAULT_BIOMETRICS, phaseLimit }; try { // Use YYYY-MM-DD format with >= and < operators for PocketBase date field @@ -86,7 +86,7 @@ export const GET = withAuth(async (_request, user, pb) => { .collection("dailyLogs") .getFirstListItem( `user="${user.id}" && date>="${today}" && date<"${tomorrow}"`, - { sort: "-created" }, + { sort: "-date" }, ); logger.info(