1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-15 01:16:22 +02:00
unleash.unleash/frontend/src/store/e-api-admin/index.js
Ivar Conradi Østhus b8b48b5726 feat: Adapt API keys to new endpoint (#259)
* 3.14.1

* more changs!

* fix: cleanup UI to match API

* fix
2021-03-29 19:32:15 +02:00

18 lines
477 B
JavaScript

import { List } from 'immutable';
import { RECIEVE_KEYS, ADD_KEY, REMOVE_KEY } from './actions';
const store = (state = new List(), action) => {
switch (action.type) {
case RECIEVE_KEYS:
return new List(action.tokens);
case ADD_KEY:
return state.push(action.token);
case REMOVE_KEY:
return state.filter(v => v.secret !== action.secret);
default:
return state;
}
};
export default store;