Use hardcover-api service with pagination

Replace the old hardcover sync usage with a new hardcover-api.service implementation that adds types, a reusable extractBooks helper, and paginated GraphQL queries (limit/offset) to fully fetch status and list books. Update API route import to use the new service. Fix ManageShelfModal to initialize rssUrl/listId as empty strings. Update tests to mock the new service and add encryption format helper mocking.
This commit is contained in:
kikootwo
2026-03-04 10:28:52 -05:00
parent 338331d006
commit 7f706e806f
5 changed files with 145 additions and 81 deletions
+2 -2
View File
@@ -19,8 +19,8 @@ interface ManageShelfModalProps {
}
export function ManageShelfModal({ shelf, isOpen, onClose }: ManageShelfModalProps) {
const [rssUrl, setRssUrl] = useState(shelf?.type === 'goodreads' ? shelf.sourceId : '');
const [listId, setListId] = useState(shelf?.type === 'hardcover' ? shelf.sourceId : '');
const [rssUrl, setRssUrl] = useState('');
const [listId, setListId] = useState('');
const [apiToken, setApiToken] = useState('');
const { updateShelf: updateGoodreads, isLoading: isUpdatingGoodreads, error: goodreadsError } = useUpdateGoodreadsShelf();