diff --git a/front/packages/models/src/query.tsx b/front/packages/models/src/query.tsx index a40967b9..bfe384e1 100644 --- a/front/packages/models/src/query.tsx +++ b/front/packages/models/src/query.tsx @@ -32,7 +32,6 @@ import { KyooErrors } from "./kyoo-errors"; import { Page, Paged } from "./page"; import { Platform } from "react-native"; import { getToken } from "./login"; -import { getSecureItem } from "./secure-store"; const kyooUrl = Platform.OS !== "web" @@ -73,7 +72,7 @@ export const queryFn = async ( ? context.path.filter((x) => x) : context.pageParam ? [context.pageParam] - : (context.queryKey.filter((x) => x) as string[]), + : (context.queryKey.filter((x, i) => x && i) as string[]), ) .join("/") .replace("/?", "?"); @@ -161,6 +160,7 @@ export type QueryPage = ComponentType & { const toQueryKey = (query: QueryIdentifier) => { if (query.params) { return [ + kyooApiUrl, ...query.path, "?" + Object.entries(query.params) @@ -169,7 +169,7 @@ const toQueryKey = (query: QueryIdentifier) => { .join("&"), ]; } else { - return query.path; + return [kyooApiUrl, ...query.path]; } };