feat: add imageSourceUrl to Zod schemas and service functions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 13:14:13 +02:00
parent 1eb4a786ce
commit d104e9788f
3 changed files with 11 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ export function getThreadWithCandidates(db: Db = prodDb, threadId: number) {
notes: threadCandidates.notes,
productUrl: threadCandidates.productUrl,
imageFilename: threadCandidates.imageFilename,
imageSourceUrl: threadCandidates.imageSourceUrl,
status: threadCandidates.status,
pros: threadCandidates.pros,
cons: threadCandidates.cons,
@@ -144,6 +145,7 @@ export function createCandidate(
name: string;
categoryId: number;
imageFilename?: string;
imageSourceUrl?: string;
},
) {
const maxRow = db
@@ -165,6 +167,7 @@ export function createCandidate(
notes: data.notes ?? null,
productUrl: data.productUrl ?? null,
imageFilename: data.imageFilename ?? null,
imageSourceUrl: data.imageSourceUrl ?? null,
status: data.status ?? "researching",
pros: data.pros ?? null,
cons: data.cons ?? null,
@@ -185,6 +188,7 @@ export function updateCandidate(
notes: string;
productUrl: string;
imageFilename: string;
imageSourceUrl: string;
status: "researching" | "ordered" | "arrived";
pros: string;
cons: string;
@@ -294,6 +298,7 @@ export function resolveThread(
notes: candidate.notes,
productUrl: candidate.productUrl,
imageFilename: candidate.imageFilename,
imageSourceUrl: candidate.imageSourceUrl,
})
.returning()
.get();