fixes
This commit is contained in:
@@ -25,12 +25,11 @@ async function init() {
|
||||
const idForFetch = currentBookId;
|
||||
|
||||
const fetchUrl = extensionName
|
||||
? `/api/book/${idForFetch.slice(0,40)}?ext=${extensionName}`
|
||||
? `/api/book/${idForFetch}?ext=${extensionName}`
|
||||
: `/api/book/${idForFetch}`;
|
||||
|
||||
const res = await fetch(fetchUrl);
|
||||
const data = await res.json();
|
||||
console.log(data);
|
||||
|
||||
if (data.error || !data) {
|
||||
const titleEl = document.getElementById('title');
|
||||
@@ -131,7 +130,7 @@ async function loadChapters(idForFetch) {
|
||||
try {
|
||||
|
||||
const fetchUrl = extensionName
|
||||
? `/api/book/${idForFetch.slice(0, 40)}/chapters`
|
||||
? `/api/book/${idForFetch}/chapters`
|
||||
: `/api/book/${idForFetch}/chapters`;
|
||||
|
||||
const res = await fetch(fetchUrl);
|
||||
|
||||
@@ -125,7 +125,7 @@ async function loadChapter() {
|
||||
`;
|
||||
|
||||
try {
|
||||
const res = await fetch(`/api/book/${bookId.slice(0,40)}/${chapter}/${provider}`);
|
||||
const res = await fetch(`/api/book/${bookId}/${chapter}/${provider}`);
|
||||
const data = await res.json();
|
||||
|
||||
if (data.title) {
|
||||
|
||||
Reference in New Issue
Block a user