diff --git a/client/src/actions/access.js b/client/src/actions/access.js index 17acb5e8..3cbc8016 100644 --- a/client/src/actions/access.js +++ b/client/src/actions/access.js @@ -51,9 +51,10 @@ export const toggleClientBlockSuccess = createAction('TOGGLE_CLIENT_BLOCK_SUCCES export const toggleClientBlock = (ip, disallowed, disallowed_rule) => async (dispatch) => { dispatch(toggleClientBlockRequest()); try { - const { - allowed_clients, blocked_hosts, disallowed_clients = [], - } = await apiClient.getAccessList(); + const accessList = await apiClient.getAccessList(); + const allowed_clients = accessList.allowed_clients ?? []; + const blocked_hosts = accessList.blocked_hosts ?? []; + const disallowed_clients = accessList.disallowed_clients ?? []; const updatedDisallowedClients = disallowed ? disallowed_clients.filter((client) => client !== disallowed_rule)