fix coverURL usage in the frontend

This commit is contained in:
David 2022-01-15 15:46:59 -05:00
parent 3e1b06e95a
commit 7ee118c1cd

View File

@ -69,8 +69,8 @@ function apiResponseParsing(book) {
if (!book["isbn-10"] && book["isbn-13"]) { if (!book["isbn-10"] && book["isbn-13"]) {
book["isbn-10"] = ISBNfromEAN(book["isbn-13"]); book["isbn-10"] = ISBNfromEAN(book["isbn-13"]);
} }
if (!book.coverurl && book["isbn-10"]) { if (!book.coverURL && book["isbn-10"]) {
book.coverurl = book.coverURL =
`https://images-na.ssl-images-amazon.com/images/P/` + `https://images-na.ssl-images-amazon.com/images/P/` +
book["isbn-10"] + book["isbn-10"] +
`.01.LZZ.jpg`; `.01.LZZ.jpg`;
@ -123,7 +123,7 @@ function ISBNfromEAN(EAN) {
function BookTemplate({ function BookTemplate({
"isbn-13": isbn13, "isbn-13": isbn13,
authors, authors,
coverurl, coverURL,
description, description,
format, format,
notes, notes,
@ -135,7 +135,7 @@ function BookTemplate({
volume, volume,
year, year,
}) { }) {
return `${coverurl ? `<img src="${coverurl}"/>` : ""} return `${coverURL ? `<img src="${coverURL}"/>` : ""}
<h1 ${onLoan ? "class='onLoan' " : ""}>${title}</h1> <h1 ${onLoan ? "class='onLoan' " : ""}>${title}</h1>
<h2>${authors}</h2> <h2>${authors}</h2>
<span>${isbn13}</span><br/> <span>${isbn13}</span><br/>