Skip to content

Commit

Permalink
fix(parentObject): Do not spread array of already fetched as parent f…
Browse files Browse the repository at this point in the history
…or underneath references
  • Loading branch information
Luc Merceron committed Jul 19, 2017
1 parent dfcdf18 commit a2eae65
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/referenceFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fetchSubRef = (ref, parentObject) => {

if (idsToFetch.length === 0) {
// If we have nothing to fetch, just continue with underneath references
if (subRefs) fetchSubRefs(subRefs, ...alreadyFetched)
if (subRefs) fetchSubRefs(subRefs, alreadyFetched)
} else {
// Else call the fetch function with the batch of ids or one by one
const fetchEnhancedCall = () => {
Expand Down
1 change: 0 additions & 1 deletion src/referenceFetcher.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ describe('FetchRefs util', () => {
const entityFactory = id => ({ id, name: `name_${id}`, org: 'organization_01', user: 'user_02', action: 'action_01' })
const entitiesFactory = ids => ids.map(id => ({ id, name: `name_${id}`, org: 'organization_01', user: 'user_02' }))
const parcelsPromise = () => new Promise(resolve => resolve({ action: 'getParcel', parcels }))
const parcelsPromiseSubstitute = () => new Promise(resolve => resolve({ action: 'getParcel', parcels }))
const subObjectPromise = (id, entity) => new Promise(resolve => resolve({ action: 'getSmthg',
[entity]: entityFactory(id) }))
const subArrayPromise = (ids, entity) => new Promise(resolve => resolve({ action: 'getSmthg',
Expand Down
2 changes: 1 addition & 1 deletion src/util/warning.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* istanbul ignore next */
/* eslint-disable */
export default function warning(message) {
/* istanbul ignore else */
if (typeof console !== 'undefined' && typeof console.error === 'function') {
console.error(message)
}
Expand Down

0 comments on commit a2eae65

Please sign in to comment.