Implemented first elements of short codes list

This commit is contained in:
Alejandro Celaya
2018-06-16 11:24:42 +02:00
parent f4c48bc94f
commit b008c37a5b
10 changed files with 134 additions and 24 deletions

View File

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