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
All checks were successful
Deploy production / deploy (push) Successful in 1m10s
This commit is contained in:
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user