web client v1.0 (production)
This commit is contained in:
@@ -92,6 +92,13 @@ const setDishes = (data) => {
|
||||
};
|
||||
};
|
||||
|
||||
const setDish = (data) => {
|
||||
return {
|
||||
type: "SET_DISH",
|
||||
payload: data,
|
||||
};
|
||||
};
|
||||
|
||||
export const fetchAllDishes = (id) => {
|
||||
return function (dispatch) {
|
||||
axios
|
||||
@@ -103,6 +110,20 @@ export const fetchAllDishes = (id) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const fetchDish = (id) => {
|
||||
return function (dispatch) {
|
||||
axios
|
||||
.get(backend + "dish/?dishId=" + id)
|
||||
.then((response) => {
|
||||
dispatch(setDish(response.data));
|
||||
})
|
||||
.catch((err) => {
|
||||
dispatch(notification("Nie udało się pobrać :(", "error"));
|
||||
dispatch(push("/"));
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
export const refreshUserData = (token) => {
|
||||
return function (dispatch) {
|
||||
axios({
|
||||
|
||||
Reference in New Issue
Block a user