fix: make legacy certification saga call api and update db

pull/35608/head
Ahmad Abdolsaheb 2019-03-25 10:51:42 +03:00 committed by Mrugesh Mohapatra
parent 68854db61e
commit 4558caf328
2 changed files with 29 additions and 1 deletions

View File

@ -1,4 +1,7 @@
import { takeEvery } from 'redux-saga/effects';
import { takeEvery, select, call } from 'redux-saga/effects';
import { putUpdateLegacyCertificate } from '../../utils/ajax';
// import { completedChallengesSelector } from './';
// import {
// updateLegacyCertificateComplete,
@ -9,8 +12,30 @@ import { takeEvery } from 'redux-saga/effects';
// import { putUserUpdateEmail } from '../../utils/ajax';
// import reallyWeirdErrorMessage from '../../utils/reallyWeirdErrorMessage';
const getProject = state => state;
// completedChallengesSelector(state);
function* updateLegacyCertificateSaga(values) {
console.log(values);
let project = yield select(getProject);
console.log(project);
const info = {
projects: {
'legacy-front-end': {
bd7158d8c242eddfaeb5bd13: 'https://gigi.io/freeCodeCamp/pe/MJjp',
bd7158d8c442eddfaeb5bd17: 'https://gigi.io/freeCodeCamp/pe/MJjp',
bd7158d8c442eddfaeb5bd18: 'https://gigi.io/freeCodeCamp/pe/MJjp',
bd7158d8c442eedfaeb5bd1c: 'https://gigi.io/freeCodeCamp/pe/MJjp'
}
}
};
const response = yield call(putUpdateLegacyCertificate, info);
console.log(response);
/* if (!email || !isEmail(email)) {
yield put(createFlashMessage(reallyWeirdErrorMessage));
return;

View File

@ -45,6 +45,9 @@ export function getArticleById(shortId) {
}
/** POST **/
export function putUpdateLegacyCertificate(body) {
return post('/update-my-projects', body);
}
export function postReportUser(body) {
return post('/user/report-user', body);