|
|
@@ -13,40 +13,40 @@ export const cursadasFetch = () => {
|
|
|
return (dispatch) => {
|
|
|
//const path = 'listaCursos.php';
|
|
|
const path = 'qwrpoiewquewquoiewquoiewq.php';
|
|
|
- post(path, { cursadas: 1 })
|
|
|
- .then( (response) => {
|
|
|
- dispatch({
|
|
|
- type: CURSADAS_FETCH_SUCCESS,
|
|
|
- payload: response
|
|
|
- });
|
|
|
- })
|
|
|
- .catch( (error) => {
|
|
|
- dispatch({
|
|
|
- type: CURSADAS_FETCH_FAIL
|
|
|
- })
|
|
|
+ post(path, { cursadas: 1 })
|
|
|
+ .then( (response) => {
|
|
|
+ dispatch({
|
|
|
+ type: CURSADAS_FETCH_SUCCESS,
|
|
|
+ payload: response
|
|
|
});
|
|
|
+ })
|
|
|
+ .catch( (error) => {
|
|
|
+ dispatch({
|
|
|
+ type: CURSADAS_FETCH_FAIL
|
|
|
+ })
|
|
|
+ });
|
|
|
};
|
|
|
};
|
|
|
|
|
|
export const cursadaFetch = ({_id}) => {
|
|
|
return (dispatch) => {
|
|
|
fetch('https://plataforma.especificosba.com.ar/back/getCourse.php', {
|
|
|
- method: 'POST',
|
|
|
- headers: {
|
|
|
- 'Accept': 'application/json',
|
|
|
- 'Content-Type': 'application/json',
|
|
|
- },
|
|
|
- body: JSON.stringify({
|
|
|
- id: _id
|
|
|
- })
|
|
|
- })
|
|
|
- .then( (response) => response.json() )
|
|
|
- .then( (responseJson) => {
|
|
|
- dispatch({
|
|
|
- type: CURSADA_FETCH_SUCCESS,
|
|
|
- payload: responseJson
|
|
|
- });
|
|
|
- });
|
|
|
+ method: 'POST',
|
|
|
+ headers: {
|
|
|
+ 'Accept': 'application/json',
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
+ },
|
|
|
+ body: JSON.stringify({
|
|
|
+ id: _id
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .then( (response) => response.json() )
|
|
|
+ .then( (responseJson) => {
|
|
|
+ dispatch({
|
|
|
+ type: CURSADA_FETCH_SUCCESS,
|
|
|
+ payload: responseJson
|
|
|
+ });
|
|
|
+ });
|
|
|
};
|
|
|
};
|
|
|
|
|
|
@@ -54,22 +54,22 @@ export const claseFetch = ({cursada, _id}) => {
|
|
|
return (dispatch) => {
|
|
|
dispatch({type: CLASE_FETCH});
|
|
|
fetch('https://plataforma.especificosba.com.ar/back/getClase.php', {
|
|
|
- method: 'POST',
|
|
|
- headers: {
|
|
|
- 'Accept': 'application/json',
|
|
|
- 'Content-Type': 'application/json',
|
|
|
- },
|
|
|
- body: JSON.stringify({
|
|
|
+ method: 'POST',
|
|
|
+ headers: {
|
|
|
+ 'Accept': 'application/json',
|
|
|
+ 'Content-Type': 'application/json',
|
|
|
+ },
|
|
|
+ body: JSON.stringify({
|
|
|
cursada,
|
|
|
- id: _id
|
|
|
- })
|
|
|
- })
|
|
|
- .then( (response) => response.json() )
|
|
|
- .then( (responseJson) => {
|
|
|
- dispatch({
|
|
|
- type: CLASE_FETCH_SUCCESS,
|
|
|
- payload: responseJson
|
|
|
- });
|
|
|
- });
|
|
|
+ id: _id
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .then( (response) => response.json() )
|
|
|
+ .then( (responseJson) => {
|
|
|
+ dispatch({
|
|
|
+ type: CLASE_FETCH_SUCCESS,
|
|
|
+ payload: responseJson
|
|
|
+ });
|
|
|
+ });
|
|
|
};
|
|
|
};
|