2017-10-08 16:52:54 +02:00
|
|
|
export const defaultState = [];
|
|
|
|
|
|
|
|
export default function groups(state = defaultState, action) {
|
2016-09-05 23:04:15 +02:00
|
|
|
switch (action.type) {
|
|
|
|
case 'ADD_GROUP': {
|
2018-05-28 14:55:44 +02:00
|
|
|
return [
|
|
|
|
...state,
|
|
|
|
{
|
|
|
|
id: action.id,
|
|
|
|
value: action.value,
|
|
|
|
active: action.active,
|
|
|
|
disabled: action.disabled,
|
|
|
|
},
|
|
|
|
];
|
2016-09-05 23:04:15 +02:00
|
|
|
}
|
2016-04-16 18:06:27 +02:00
|
|
|
|
2016-10-19 08:33:38 +02:00
|
|
|
case 'CLEAR_CHOICES': {
|
2017-08-15 10:29:42 +02:00
|
|
|
return [];
|
2016-10-19 08:33:38 +02:00
|
|
|
}
|
|
|
|
|
2016-09-05 23:04:15 +02:00
|
|
|
default: {
|
|
|
|
return state;
|
2016-04-16 18:06:27 +02:00
|
|
|
}
|
2016-09-05 23:04:15 +02:00
|
|
|
}
|
2017-10-08 16:52:54 +02:00
|
|
|
}
|