This commit is contained in:
2025-12-02 21:16:05 +01:00
parent 01376362af
commit f479d87584
4 changed files with 5 additions and 11 deletions

View File

@@ -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);

View File

@@ -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) {