This repository has been archived on 2026-07-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
cloud-reader/frontend/src/api/loadEbookWithProgress.ts
T
2026-06-04 06:42:27 -05:00

15 lines
454 B
TypeScript

import { booksApi } from "@/api/books";
import { getReadingProgress } from "@/api/reader";
import type { ReadingProgress } from "@/types/reader";
export async function loadEbookWithProgress(bookId: number): Promise<{
progressData: ReadingProgress | null;
blob: Blob;
}> {
const [progressData, blob] = await Promise.all([
getReadingProgress(bookId).catch(() => null),
booksApi.getEbookFile(bookId),
]);
return { progressData, blob };
}