Skip to content

Commit

Permalink
fix(entity): Warning when an object retrieve with fetch does not cont…
Browse files Browse the repository at this point in the history
…ain the entity asked and stop t
  • Loading branch information
Luc Merceron committed Jul 19, 2017
1 parent a2eae65 commit b5c172e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/referenceFetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ const fetchRefs = structure => {
if (subRefs && subRefs.length > 0) {
// Get the result entity
fetch().then(({ [entity]: rootObject }) => {
// Verify if the entity attribute actually gave something to work on
if (!rootObject) {
warning(`the entity ${entity} does not exist in object ${JSON.stringify(rootObject, null, 2)}`)
return
}
// Register our fetch result in order to avoid unecessary recall later one
rootFetchCalled[funcSignature] = rootObject
// Fetch entities for each sub-references
Expand Down

0 comments on commit b5c172e

Please sign in to comment.