revert: replace axios with fetch

This reverts commit 82f3f6ae0c via PR #41944.
This commit is contained in:
Mrugesh Mohapatra
2021-06-16 16:44:32 +05:30
parent e402464304
commit 418287f1e8
9 changed files with 36 additions and 72 deletions

View File

@@ -26,7 +26,7 @@ import { createFlashMessage } from '../../components/Flash/redux';
function* submitNewAboutSaga({ payload }) {
try {
const response = yield call(putUpdateMyAbout, payload);
const { data: response } = yield call(putUpdateMyAbout, payload);
yield put(submitNewAboutComplete({ ...response, payload }));
yield put(createFlashMessage(response));
} catch (e) {
@@ -36,7 +36,7 @@ function* submitNewAboutSaga({ payload }) {
function* submitNewUsernameSaga({ payload: username }) {
try {
const response = yield call(putUpdateMyUsername, username);
const { data: response } = yield call(putUpdateMyUsername, username);
yield put(submitNewUsernameComplete({ ...response, username }));
yield put(createFlashMessage(response));
} catch (e) {
@@ -46,7 +46,7 @@ function* submitNewUsernameSaga({ payload: username }) {
function* submitProfileUISaga({ payload }) {
try {
const response = yield call(putUpdateMyProfileUI, payload);
const { data: response } = yield call(putUpdateMyProfileUI, payload);
yield put(submitProfileUIComplete({ ...response, payload }));
yield put(createFlashMessage(response));
} catch (e) {
@@ -56,7 +56,7 @@ function* submitProfileUISaga({ payload }) {
function* updateUserFlagSaga({ payload: update }) {
try {
const response = yield call(putUpdateUserFlag, update);
const { data: response } = yield call(putUpdateUserFlag, update);
yield put(updateUserFlagComplete({ ...response, payload: update }));
yield put(createFlashMessage(response));
} catch (e) {
@@ -67,7 +67,9 @@ function* updateUserFlagSaga({ payload: update }) {
function* validateUsernameSaga({ payload }) {
try {
yield delay(500);
const { exists } = yield call(getUsernameExists, payload);
const {
data: { exists }
} = yield call(getUsernameExists, payload);
yield put(validateUsernameComplete(exists));
} catch (e) {
yield put(validateUsernameError(e));
@@ -76,10 +78,9 @@ function* validateUsernameSaga({ payload }) {
function* verifyCertificationSaga({ payload }) {
try {
const { response, isCertMap, completedChallenges } = yield call(
putVerifyCert,
payload
);
const {
data: { response, isCertMap, completedChallenges }
} = yield call(putVerifyCert, payload);
yield put(
verifyCertComplete({
...response,