Sort by author

This commit is contained in:
aditya.chandel
2025-03-08 00:19:36 -07:00
parent 59ff589bd2
commit 4d9b0423ba
2 changed files with 2 additions and 0 deletions
@@ -9,6 +9,7 @@ export class SortService {
private readonly fieldExtractors: Record<string, (book: Book) => any> = {
title: (book) => book.metadata?.title?.toLowerCase() || null,
author: (book) => book.metadata?.authors?.map(a => a.toLowerCase()).join(", ") || null,
publishedDate: (book) =>book.metadata?.publishedDate === null ? null : new Date(book.metadata?.publishedDate!).getTime(),
publisher: (book) => book.metadata?.publisher || null,
pageCount: (book) => book.metadata?.pageCount || null,