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:
@@ -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);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user