fix: align moments range and failed filter

This commit is contained in:
William Valentin
2026-02-05 09:17:16 -08:00
parent 523460f639
commit d93caedb31
2 changed files with 9 additions and 2 deletions

View File

@@ -204,10 +204,14 @@ export function TimelineTree(props: {
setMomentsError(null);
if (!rows || rows.length === 0) return;
const start = rows[0]?.group_ts ?? null;
const end = rows[rows.length - 1]?.group_ts ?? null;
const last = rows[rows.length - 1]?.group_ts ?? null;
const end = last
? new Date(new Date(last).getTime() + 24 * 60 * 60 * 1000).toISOString()
: null;
const params = new URLSearchParams();
if (start) params.set("start", start);
if (end) params.set("end", end);
params.set("includeFailed", "1");
const res = await fetch(`/api/moments?${params.toString()}`, {
cache: "no-store",
});