Books list: make the buttons work like in the form

This commit is contained in:
2026-03-26 17:07:22 +01:00
parent 4d687e3dcb
commit d8fc7396ff
6 changed files with 111 additions and 27 deletions

View File

@@ -107,7 +107,7 @@ export async function postImportBook(id, language) {
}
export async function putReadBook(bookId) {
return genericPayloadCall('/ws/book/' + bookId, { read: true }, 'PUT')
return putEndReadDate(bookId, new Date().toISOString().slice(0, 10))
}
export async function putUnreadBook(bookId) {
@@ -126,6 +126,10 @@ export async function putStartReadDateUnset(bookId) {
return genericPayloadCall('/ws/book/' + bookId, { startDate: 'null' }, 'PUT')
}
export async function putStartRead(bookId) {
return putStartReadDate(bookId, new Date().toISOString().slice(0, 10))
}
export async function putStartReadDate(bookId, startdate) {
return genericPayloadCall('/ws/book/' + bookId, { startDate: startdate }, 'PUT')
}