Skip to content

Commit

Permalink
Companies are sorted alphabetically by default: fix redpelicans#39.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias LECONTE authored and Sofiane KHATIR committed Mar 16, 2017
1 parent 3d71b53 commit bc56577
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/reducers/companies.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ const make = (company) => {
};
const makeAll = R.compose(R.fromPairs, R.map(c => [c._id, make(c)]));

const companies = (state = { data: {}, sort: {} }, action) => {
const initialState = {
data: {},
sort: { by: 'name', order: 'asc' },
filter: '',
};

const companies = (state = initialState, action) => {
switch (action.type) {
case TOGGLE_PREFERRED_FILTER:
return { ...state, preferredFilter: !state.preferredFilter };
Expand Down

0 comments on commit bc56577

Please sign in to comment.