Added more behavior to servers list

This commit is contained in:
Alejandro Celaya
2018-06-14 20:11:41 +02:00
parent 9ac0811200
commit e4356720d7
7 changed files with 91 additions and 32 deletions

View File

@@ -0,0 +1,19 @@
import ServersService from '../services';
const LOAD_SERVER = 'shlink/LOAD_SERVER';
export default function selectedServerReducer(state = null, action) {
switch (action.type) {
case LOAD_SERVER:
return action.selectedServer;
}
return state;
}
export const loadServer = serverId => {
return {
type: LOAD_SERVER,
selectedServer: ServersService.findServerById(serverId),
};
};