fix: make legacy certification saga call api and update db
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
68854db61e
commit
4558caf328
@@ -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 {
|
// import {
|
||||||
// updateLegacyCertificateComplete,
|
// updateLegacyCertificateComplete,
|
||||||
@@ -9,8 +12,30 @@ import { takeEvery } from 'redux-saga/effects';
|
|||||||
// import { putUserUpdateEmail } from '../../utils/ajax';
|
// import { putUserUpdateEmail } from '../../utils/ajax';
|
||||||
// import reallyWeirdErrorMessage from '../../utils/reallyWeirdErrorMessage';
|
// import reallyWeirdErrorMessage from '../../utils/reallyWeirdErrorMessage';
|
||||||
|
|
||||||
|
const getProject = state => state;
|
||||||
|
|
||||||
|
// completedChallengesSelector(state);
|
||||||
|
|
||||||
function* updateLegacyCertificateSaga(values) {
|
function* updateLegacyCertificateSaga(values) {
|
||||||
console.log(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)) {
|
/* if (!email || !isEmail(email)) {
|
||||||
yield put(createFlashMessage(reallyWeirdErrorMessage));
|
yield put(createFlashMessage(reallyWeirdErrorMessage));
|
||||||
return;
|
return;
|
||||||
|
@@ -45,6 +45,9 @@ export function getArticleById(shortId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** POST **/
|
/** POST **/
|
||||||
|
export function putUpdateLegacyCertificate(body) {
|
||||||
|
return post('/update-my-projects', body);
|
||||||
|
}
|
||||||
|
|
||||||
export function postReportUser(body) {
|
export function postReportUser(body) {
|
||||||
return post('/user/report-user', body);
|
return post('/user/report-user', body);
|
||||||
|
Reference in New Issue
Block a user