perf: promise all on ssr pages
This commit is contained in:
@@ -42,14 +42,10 @@ async function getLibrarySeries(
|
||||
try {
|
||||
const pageIndex = page - 1;
|
||||
|
||||
const series: LibraryResponse<KomgaSeries> = await LibraryService.getLibrarySeries(
|
||||
libraryId,
|
||||
pageIndex,
|
||||
size,
|
||||
unreadOnly,
|
||||
search
|
||||
);
|
||||
const library: KomgaLibrary = await LibraryService.getLibrary(libraryId);
|
||||
const [series, library] = await Promise.all([
|
||||
LibraryService.getLibrarySeries(libraryId, pageIndex, size, unreadOnly, search),
|
||||
LibraryService.getLibrary(libraryId)
|
||||
]);
|
||||
|
||||
return { data: series, library };
|
||||
} catch (error) {
|
||||
|
||||
@@ -27,13 +27,10 @@ async function getSeriesBooks(
|
||||
try {
|
||||
const pageIndex = page - 1;
|
||||
|
||||
const books: LibraryResponse<KomgaBook> = await SeriesService.getSeriesBooks(
|
||||
seriesId,
|
||||
pageIndex,
|
||||
size,
|
||||
unreadOnly
|
||||
);
|
||||
const series: KomgaSeries = await SeriesService.getSeries(seriesId);
|
||||
const [books, series] = await Promise.all([
|
||||
SeriesService.getSeriesBooks(seriesId, pageIndex, size, unreadOnly),
|
||||
SeriesService.getSeries(seriesId)
|
||||
]);
|
||||
|
||||
return { data: books, series };
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user