Add book title to autocomplete suggestions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -756,13 +756,14 @@ async def list_jobs(
|
||||
|
||||
@app.get("/api/jobs/suggestions")
|
||||
async def job_suggestions():
|
||||
"""Return distinct values for author, chapter, and reviewer_name to power autocomplete."""
|
||||
"""Return distinct values for author, book, chapter, and reviewer_name to power autocomplete."""
|
||||
try:
|
||||
with get_db() as conn:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("""
|
||||
SELECT
|
||||
array_remove(array_agg(DISTINCT author ORDER BY author), NULL) AS authors,
|
||||
array_remove(array_agg(DISTINCT book ORDER BY book), NULL) AS books,
|
||||
array_remove(array_agg(DISTINCT chapter ORDER BY chapter), NULL) AS chapters,
|
||||
array_remove(array_agg(DISTINCT reviewer_name ORDER BY reviewer_name), NULL) AS reviewers
|
||||
FROM ocr_jobs
|
||||
@@ -774,6 +775,7 @@ async def job_suggestions():
|
||||
|
||||
return JSONResponse({
|
||||
"authors": row["authors"] or [],
|
||||
"books": row["books"] or [],
|
||||
"chapters": row["chapters"] or [],
|
||||
"reviewers": row["reviewers"] or [],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user