Skip to content

fix(book): save a picked series when saving the book editor - #52

Closed
audemed44 wants to merge 1 commit into
mainfrom
fix/edit-book-pending-series
Closed

audemed44 wants to merge 1 commit into
mainfrom
fix/edit-book-pending-series

Conversation

@audemed44

Copy link
Copy Markdown
Owner

Problem

In the book editor, a series is only assigned when you press the ✓ in the series row. Save Changes saved the text fields and silently dropped a series that was picked but not confirmed.

That was easy to miss, especially when adding from Z-Library, where the editor fills in the series by itself. Four books added that way today (Beneath the Dragoneye Moons 1–4) ended up in no series, even though the series was created. The live logs show POST /api/series and the PATCHes, but no POST /api/series/{id}/books/{book}.

Fix

  • Save Changes now first adds the book to the series picked in the add row, with its number, then saves the rest.
  • If adding the series fails, the editor stays open and shows the error.
  • A row whose text doesn't match an existing series (nothing picked) is still ignored, so an unwanted Z-Library suggestion doesn't block saving.

Testing

  • New Vitest case: add from Z-Library → series preselected → Save Changes sends POST /api/series/4/books/b1?sequence=2 before the PATCH. It fails on the old editor and passes with the fix.
  • Frontend lint, prettier, tsc, all tests and the build pass.

Adding a book to a series needed the ✓ in the series row; Save Changes only
saved the text fields and dropped a series that was picked but not
confirmed. That was easy to miss, most of all after adding a book from
Z-Library, where the editor picks the series itself: four books added that
way ended up in no series. Save now adds the picked series (with its
number) first, and stays open with the error if that fails.
@audemed44

Copy link
Copy Markdown
Owner Author

Folded into #51 as a new commit.

@audemed44 audemed44 closed this Oct 11, 2026
@audemed44
audemed44 deleted the fix/edit-book-pending-series branch October 11, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant