diff --git a/client/src/redux/settings/update-legacy-certificate-saga.js b/client/src/redux/settings/update-legacy-certificate-saga.js index 660a8f18f5..42cb2a81b0 100644 --- a/client/src/redux/settings/update-legacy-certificate-saga.js +++ b/client/src/redux/settings/update-legacy-certificate-saga.js @@ -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; diff --git a/client/src/utils/ajax.js b/client/src/utils/ajax.js index cb22cd4891..44407df33b 100644 --- a/client/src/utils/ajax.js +++ b/client/src/utils/ajax.js @@ -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);