Fix type issues

This commit is contained in:
Zoe Roux 2023-09-09 18:48:53 +02:00
parent 67deef897f
commit 31d9507033
2 changed files with 3 additions and 3 deletions

View File

@ -155,7 +155,7 @@ export type QueryIdentifier<T = unknown, Ret = T> = {
parser: z.ZodType<T, z.ZodTypeDef, any>;
path: (string | undefined)[];
params?: { [query: string]: boolean | number | string | string[] | undefined };
infinite?: boolean | { value: true; map?: (x: T[]) => Ret[] };
infinite?: boolean | { value: true; map?: (x: any[]) => Ret[] };
/**
* A custom get next function if the infinite query is not a page.
*/
@ -163,7 +163,7 @@ export type QueryIdentifier<T = unknown, Ret = T> = {
};
export type QueryPage<Props = {}> = ComponentType<Props> & {
getFetchUrls?: (route: { [key: string]: string }) => QueryIdentifier[];
getFetchUrls?: (route: { [key: string]: string }) => QueryIdentifier<any>[];
getLayout?:
| QueryPage<{ page: ReactElement }>
| { Layout: QueryPage<{ page: ReactElement }>; props: object };

View File

@ -123,7 +123,7 @@ export const EpisodeList = <Props,>({
headerProps={headerProps}
>
{(item) => {
const sea = item ? seasons?.find((x) => x.seasonNumber === item.seasonNumber) : null;
const sea = item?.firstOfSeason ? seasons?.find((x) => x.seasonNumber === item.seasonNumber) : null;
return (
<>
{item.firstOfSeason && (