diff --git a/imports/client.tsx b/imports/client.tsx index 3ee8bf75..789fc5ad 100644 --- a/imports/client.tsx +++ b/imports/client.tsx @@ -1951,7 +1951,7 @@ export class DeepClient = Link> implements DeepClientInst if (typeof(start) === 'object') { return ((await this.select(start)) as any)?.data?.[0]?.id; } - if (_ids?.[start]?.[path[0]]) { + if (path.length === 2 && _ids?.[start]?.[path[0]]) { return _ids[start][path[0]]; } const q = await this.select(pathToWhere(start, ...path)); diff --git a/imports/minilinks.tsx b/imports/minilinks.tsx index 6b1f501e..47a7c54f 100644 --- a/imports/minilinks.tsx +++ b/imports/minilinks.tsx @@ -379,7 +379,7 @@ export class MinilinkCollection>]; + const paths = [start, ...(path[path.length - 1] === true ? path.slice(0, -1) : path)] as [Id, ...Array>]; // let result: number; // if(paths.length === 1) { @@ -397,7 +397,7 @@ export class MinilinkCollection)?.id; - if(!result) { + if(!result && path[path.length - 1] !== true) { const precached = get(_ids, paths.join('.')); if (precached) return precached; throw new Error(`Id not found by ${JSON.stringify([start, ...path])}`);