make work with prefixed url

This commit is contained in:
Tuomas Katajisto 2025-08-01 20:38:17 +03:00
parent 9e2fef2433
commit a218e826b2

View File

@ -25,7 +25,7 @@
<div class="book-grid"> <div class="book-grid">
{{range .books}} {{range .books}}
<div class="book-card"> <div class="book-card">
<img src="{{.ImagePath}}" alt="Cover of {{.Name}}"> <img src="./{{.ImagePath}}" alt="Cover of {{.Name}}">
<div class="book-details"> <div class="book-details">
<h2>{{.Name}}</h2> <h2>{{.Name}}</h2>
<div class="checkbox-group"> <div class="checkbox-group">
@ -59,7 +59,7 @@
console.log(`Updating Book ID: ${bookId}, Person: ${person}, Read: ${isRead}`); console.log(`Updating Book ID: ${bookId}, Person: ${person}, Read: ${isRead}`);
// Send the data to the backend API endpoint // Send the data to the backend API endpoint
fetch(`/books/${bookId}/update`, { fetch(`./books/${bookId}/update`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',