Fix GridFieldComponent not rendering all records

This commit is contained in:
David Craig 2016-04-22 14:59:05 +12:00 committed by Ingo Schommer
parent b2e8fd96ec
commit 2f7a7c3a5c

View File

@ -29,7 +29,7 @@ function recordsReducer(state = initialState, action) {
recordType = action.payload.recordType;
// TODO Automatic pluralisation from recordType
records = action.payload.data._embedded[`${recordType}s`] || {};
records = records.reduce((prev, val) => Object.assign({}, prev, { [val.id]: val }), {});
records = records.reduce((prev, val) => Object.assign({}, prev, { [val.ID]: val }), {});
return deepFreeze(Object.assign({}, state, {
[recordType]: records,
}));