Start reading cancel read: move logic to backend

This commit is contained in:
2026-03-26 20:17:21 +01:00
parent 9c18206483
commit bc077f176e
4 changed files with 15 additions and 8 deletions

View File

@@ -72,7 +72,6 @@ async function onStartReadIconClick() {
}
if (data.value.read) {
data.value.read = false
putUnreadBook(props.id)
}
}

View File

@@ -86,17 +86,12 @@ async function onUserBookStartRead() {
async function userBookStartRead() {
const res = await putStartRead(props.id)
if (!res.ok) {
res.json().then((json) => (error.value = json))
return
}
const resp = await putUnreadBook(props.id)
if (resp.ok) {
if (res.ok) {
currentStartReadDate.value = today
isRead.value = false
isWantRead.value = false
} else {
resp.json().then((json) => (error.value = json))
res.json().then((json) => (error.value = json))
}
}