19 lines
413 B
JavaScript
Raw Normal View History

2017-11-10 14:20:33 +01:00
import { fork, takeLatest, put } from 'redux-saga/effects';
import { submitSucceeded } from './actions';
import { SUBMIT } from './constants';
export function* submitForm() {
try {
// TODO dynamic
yield put(submitSucceeded());
} catch(error) {
window.Strapi.notification.error('An error occured');
}
}
export default function* defaultSaga() {
2017-11-10 14:20:33 +01:00
yield fork(takeLatest, SUBMIT, submitForm);
}