Skip to content
Snippets Groups Projects
Commit 225d0c87 authored by Chif Gergő's avatar Chif Gergő
Browse files

Merge branch 'news_page' of https://github.com/DevTeamSCH/kszkepzes-frontend into statistics

parents 689acfe2 c39b6f1e
No related branches found
No related tags found
No related merge requests found
// TODO: Separate actions
import axios from './session';
import { GET_USERDATA, PROFILE_CHANGE, GROUP_CHANGE } from './types';
import ax from 'axios';
import { GET_USERDATA, PROFILE_CHANGE, GROUP_CHANGE, GET_NEWS } from './types';
export const axios = ax.create({
xsrfCookieName: 'csrftoken',
xsrfHeaderName: 'X-CSRFToken',
});
export const getUserData = () => (
async (dispatch) => {
......@@ -34,20 +28,6 @@ export const getUserData = () => (
}
);
export const getNews = () => (
async (dispatch) => {
try {
const response = await axios.get('/api/v1/news');
dispatch({
type: GET_NEWS,
payload: response.data,
});
} catch (e) {
console.log(e);
}
}
);
export const textChange = ({ target: { name, value } }) => (
(dispatch) => {
dispatch({ type: PROFILE_CHANGE, payload: value, target: name });
......
import { axios } from './auth';
import axios from './session';
import { GET_NEWS, WRITE_NEWS, ADD_NEWS, DELETE_NEWS,
CLEAR_WRITE, SELECT_NEWS, EDIT_NEWS } from './types';
......
import ax from 'axios';
const axios = ax.create({
xsrfCookieName: 'csrftoken',
xsrfHeaderName: 'X-CSRFToken',
});
export default axios;
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