Skip to content

Commit

Permalink
fix: userBook details on bookCard in search, author, and series views (
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-rozen authored Nov 3, 2024
1 parent 9e1b74c commit 89fa0df
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/jelu-ui/src/utils/ObjectUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,20 @@ export class ObjectUtils {
public static toUserBook = (book: Book): UserBook => {
const converted = {
id: book.userBookId != null ? book.userBookId : null,
book: book
book: book,
lastReadingEvent: book.userbook?.lastReadingEvent != null ? book.userbook?.lastReadingEvent : null,
lastReadingEventDate: book.userbook?.lastReadingEventDate != null ? book.userbook?.lastReadingEventDate : null,
creationDate: book.userbook?.creationDate != null ? book.userbook?.creationDate : null,
modificationDate: book.userbook?.modificationDate != null ? book.userbook?.modificationDate : null,
personalNotes: book.userbook?.personalNotes != null ? book.userbook?.personalNotes : null,
owned: book.userbook?.owned != null ? book.userbook?.owned : null,
borrowed: book.userbook?.borrowed != null ? book.userbook?.borrowed : null,
toRead: book.userbook?.toRead != null ? book.userbook?.toRead : null,
readingEvents: book.userbook?.readingEvents != null ? book.userbook?.readingEvents : null,
percentRead: book.userbook?.percentRead != null ? book.userbook?.percentRead : null,
currentPageNumber: book.userbook?.currentPageNumber != null ? book.userbook?.currentPageNumber : null,
avgRating: book.userbook?.avgRating != null ? book.userbook?.avgRating : null,
userAvgRating: book.userbook?.userAvgRating != null ? book.userbook?.userAvgRating : null
} as UserBook
// console.log('after')
// console.log(converted)
Expand Down

0 comments on commit 89fa0df

Please sign in to comment.