Added modal window for server deletion

This commit is contained in:
Alejandro Celaya
2018-07-20 22:14:17 +02:00
parent 0de191ac0b
commit 168b24344e
7 changed files with 120 additions and 38 deletions

View File

@@ -2,10 +2,12 @@ import ServersService from '../services';
const FETCH_SERVERS = 'shlink/servers/FETCH_SERVERS';
const CREATE_SERVER = 'shlink/servers/CREATE_SERVER';
const DELETE_SERVER = 'shlink/servers/DELETE_SERVER';
export default function reducer(state = {}, action) {
switch (action.type) {
case FETCH_SERVERS:
case DELETE_SERVER:
return action.servers;
case CREATE_SERVER:
const server = action.server;
@@ -26,3 +28,8 @@ export const createServer = server => {
ServersService.createServer(server);
return listServers();
};
export const deleteServer = server => {
ServersService.deleteServer(server);
return listServers();
};