Skip to content
Snippets Groups Projects
Commit 88afb9f3 authored by Barnabás Czémán's avatar Barnabás Czémán
Browse files

catch errors

parent e045cd1e
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ const axios = ax.create({
export const getUserData = () => (
async (dispatch) => {
try {
const user = await axios.get('/api/v1/profiles/me');
const {
id,
......@@ -27,17 +28,19 @@ export const getUserData = () => (
id, joinDate, nick, motivationAbout, motivationProfession, motivationExercise, signed, groups,
},
});
} catch (e) {}
}
);
export const getNews = () => (
async (dispatch) => {
try {
const response = await axios.get('/api/v1/news');
if(response) {
dispatch({
type: GET_NEWS,
payload: response.data,
});
} catch(e) {
}
}
......@@ -57,6 +60,7 @@ export const submitRegistration = ({
nick, groups, signed, motivationAbout, motivationProfession, motivationExercise, id,
}) => (
async (dispatch) => {
try {
const response = await axios.patch(`/api/v1/profiles/${id}/`, {
nick,
groups,
......@@ -70,5 +74,6 @@ export const submitRegistration = ({
} else {
alert('Mentés nem sikerült!');
}
} catch(e) {}
}
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment