Skip to content
Snippets Groups Projects
Commit fc2dcf22 authored by Tamás Szabó's avatar Tamás Szabó
Browse files

motivation hack

parent db7f2b55
No related branches found
No related tags found
No related merge requests found
......@@ -14,10 +14,14 @@ export const getUserData = () => (
const {
id, join_date: joinDate, nick, motivation, signed, groups,
} = user.data;
const motivationJSON = JSON.parse(motivation);
const motivationAbout = motivationJSON.first;
const motivationProfession = motivationJSON.second;
const motivationExercise = motivationJSON.third;
dispatch({
type: GET_USERDATA,
payload: {
id, joinDate, nick, motivation, signed, groups,
id, joinDate, nick, motivationAbout, motivationProfession, motivationExercise, signed, groups,
},
});
}
......@@ -51,7 +55,7 @@ export const submitRegistration = ({
}) => (
async (dispatch) => {
const response = await axios.patch(`/api/v1/profiles/${id}/`, {
nick, groups, signed, motivationAbout, motivationProfession, motivationExercise,
nick, groups, signed, motivation: JSON.stringify({ first: motivationAbout, second: motivationProfession, third: motivationExercise }),
});
if (response.data.id === id) {
alert('Sikeres mentés!');
......
......@@ -8,7 +8,7 @@ import 'semantic-ui-css/semantic.min.css';
import configureStore from './configureStore';
import App from './components/App';
// import registerServiceWorker from './registerServiceWorker';
import registerServiceWorker from './registerServiceWorker';
const store = configureStore();
......@@ -21,4 +21,4 @@ render(
document.getElementById('root'),
);
// registerServiceWorker();
registerServiceWorker();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment