Archived
15 lines
454 B
TypeScript
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 };
|
|
}
|