Skip to content
This repository has been archived by the owner on Jul 15, 2019. It is now read-only.

Commit

Permalink
bugfix on load - references not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
mjashanks committed Jul 1, 2019
1 parent babcb77 commit 11c29ab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/recordApi/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
keyBy, mapValues, filter, map, includes,
constant, last,
} from 'lodash/fp';
import { getExactNodeForPath } from '../templateApi/hierarchy';
import { getExactNodeForPath, getNode } from '../templateApi/hierarchy';
import { safeParseField } from '../types';
import {
$, splitKey, safeKey, isNonEmptyString,
Expand Down Expand Up @@ -43,7 +43,7 @@ export const _load = async (app, key, keyStack = []) => {
&& !includes(loadedRecord[f.name].key)(newKeyStack)),
map(f => ({
promise: _load(app, loadedRecord[f.name].key, newKeyStack),
index: getExactNodeForPath(app.hierarchy)(f.typeOptions.indexNodeKey),
index: getNode(app.hierarchy, f.typeOptions.indexNodeKey),
field: f,
})),
]);
Expand Down
6 changes: 4 additions & 2 deletions test/specHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export const setupApphierarchy = async (creator, disableCleanupTransactions=fals
recordApi._storeHandle = app.datastore;
actionsApi._app = app;

return ({
const apis = {
recordApi,
collectionApi,
templateApi,
Expand All @@ -371,7 +371,9 @@ export const setupApphierarchy = async (creator, disableCleanupTransactions=fals
appHierarchy:hierarchy,
subscribe:templateApi._eventAggregator.subscribe,
app
});
};

return apis;
};

const disableCleanupTransactions = app => {
Expand Down

0 comments on commit 11c29ab

Please sign in to comment.