spotters: fix 500 on detail pages of seen items (timestamp comes back as text); logos script uses small separate Wikidata queries
All checks were successful
Deploy production / deploy (push) Successful in 1m10s

This commit is contained in:
2026-10-25 14:10:52 +00:00
parent 0f8db8e432
commit 11fa8ec006
2 changed files with 50 additions and 46 deletions

View File

@@ -62,11 +62,10 @@ export async function idsProgress(tracker: Tracker, ids: number[]) {
export async function getSeen(tracker: Tracker, id: number): Promise<SeenEntry | null> {
const { col } = T[tracker];
const [r] = await client.unsafe<{ seen_on: string | null; note: string | null; at: Date }[]>(
`select seen_on::text, note, created_at as at from ${tracker}.seen where ${col} = $1`,
[id]
);
return r ? { seenOn: r.seen_on, note: r.note, at: r.at.toISOString() } : null;
const [r] = await client.unsafe<
{ seen_on: string | null; note: string | null; at: string | Date }[]
>(`select seen_on::text, note, created_at as at from ${tracker}.seen where ${col} = $1`, [id]);
return r ? { seenOn: r.seen_on, note: r.note, at: new Date(r.at).toISOString() } : null;
}
/** Marks (or unmarks) an item as seen. Returns false when the item does not exist. */