Fix/request manager infinite swr requests (#306)

* Fix RequestManager initial infinite swr requests

Functions always returned "null" as the url, which causes SWR to not send the request

 - useGetSourceLatestMangas
 - useSourceSearch
 - useSourceQuickSearch

* Use "skipRequest" for infinite SWR requests

Is easier to use then overwriting "getEndpoint" only for specific cases

* Request correct first page for infinite SWR requests

The following endpoints start at page 1
 - popular source mangas
 - latest source mangas
 - source search
 - source quick search

* Remove wrong parameter from source manga browse requests

No idea why I've added this in the first place

* Correctly request "latest" and "popular" source mangas

The "page" wasn't a param of the query but part of the endpoint
This commit is contained in:
schroda
2023-05-20 13:12:23 +02:00
committed by GitHub
parent feac34ba83
commit 0cd5720f54
2 changed files with 26 additions and 20 deletions

View File

@@ -330,6 +330,11 @@ export interface PaginatedList<T> {
hasNextPage: boolean;
}
export type PaginatedMangaList = {
mangaList: IManga[];
hasNextPage: boolean;
};
export type NullAndUndefined<T> = T | null | undefined;
export type ChapterSortMode = 'fetchedAt' | 'source';