mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-12 01:26:21 +00:00
Added more behavior to servers list
This commit is contained in:
19
src/servers/reducers/selectedServer.js
Normal file
19
src/servers/reducers/selectedServer.js
Normal 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),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user