Skip to content

Commit

Permalink
Merge pull request #590 from marmelab/duble_reference
Browse files Browse the repository at this point in the history
[RFR] Fix problem with multiple references on same entity
  • Loading branch information
fzaninotto committed Aug 5, 2015
2 parents 693f712 + 1a250bf commit 33c7824
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/javascripts/ng-admin/Crud/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ function routing($stateProvider) {
references[name].targetEntity().name(),
references[name].targetEntity().identifier().name()
);

dataStore.setEntries(
references[name].targetEntity().uniqueId + '_values',
referencedEntries
);
referencedEntries.map(entry => dataStore.addEntry(references[name].targetEntity().uniqueId + '_values', entry));
}

return true;
Expand Down Expand Up @@ -208,11 +204,7 @@ function routing($stateProvider) {
references[name].targetEntity().name(),
references[name].targetEntity().identifier().name()
);

dataStore.setEntries(
references[name].targetEntity().uniqueId + '_values',
referencedEntries
);
referencedEntries.map(entry => dataStore.addEntry(references[name].targetEntity().uniqueId + '_values', entry))
}

return true;
Expand Down Expand Up @@ -250,6 +242,7 @@ function routing($stateProvider) {
dataStore.fillReferencesValuesFromEntry(entry, view.getReferences(), true);

dataStore.addEntry(view.getEntity().uniqueId, entry);

return true;
}]
}
Expand Down Expand Up @@ -347,11 +340,7 @@ function routing($stateProvider) {
references[name].targetEntity().name(),
references[name].targetEntity().identifier().name()
);

dataStore.setEntries(
references[name].targetEntity().uniqueId + '_values',
referencedEntries
);
referencedEntries.map(entry => dataStore.addEntry(references[name].targetEntity().uniqueId + '_values', entry))
}

return true;
Expand Down

0 comments on commit 33c7824

Please sign in to comment.