include api status in result

This commit is contained in:
Matthias Hannig 2018-10-02 10:29:43 +02:00
parent 523b5fd478
commit c4c41a4d10

View File

@ -115,12 +115,13 @@ export function loadRouteserverProtocolRequest(routeserverId) {
}
}
export function loadRouteserverProtocolSuccess(routeserverId, protocol) {
export function loadRouteserverProtocolSuccess(routeserverId, protocol, api) {
return {
type: LOAD_ROUTESERVER_PROTOCOL_SUCCESS,
payload: {
routeserverId: routeserverId,
protocol: protocol
protocol: protocol,
api: api
}
}
}
@ -130,7 +131,12 @@ export function loadRouteserverProtocol(routeserverId) {
dispatch(loadRouteserverProtocolRequest(routeserverId));
axios.get(`/api/routeservers/${routeserverId}/neighbours`)
.then(({data}) => {
dispatch(loadRouteserverProtocolSuccess(routeserverId, data.neighbours));
console.log("LRS:", data);
dispatch(loadRouteserverProtocolSuccess(
routeserverId,
data.neighbours,
data.api,
));
})
.catch((error) => dispatch(apiError(error)));
}