1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00

fixed end point - fixed posts in metadata

This commit is contained in:
2016-09-13 04:37:56 +00:00
parent e558fe5da2
commit e5d340df5d
10 changed files with 102 additions and 18 deletions

View File

@@ -22,6 +22,13 @@ function loadSensorInfoMonth(sensor_info){
}
}
function loadUniqueDates(dates){
return{
type: types.LOAD_UNIQUE_DATES,
dates
}
}
function fetchingList(){
return {
type: types.FETCHING_LIST
@@ -40,6 +47,12 @@ function fetchingInfoMonth(){
}
}
function fetchingUniqueDates(){
return {
type: types.FETCHING_UNIQUE_DATES
}
}
export function fetchSensorList(){
return (dispatch) => {
dispatch(fetchingList());
@@ -80,4 +93,18 @@ export function fetchSensorInfoMonth(location, year, month){
console.log(error);
});
}
}
export function fetchUniqueDates(location){
return (dispatch) => {
dispatch(fetchingUniqueDates());
return fetch(`/api/uniquedates/${location}`)
.then(response => response.json())
.then(json => {
dispatch(loadUniqueDates(json));
})
.catch(error => {
console.log(error);
});
}
}