@@ -12,11 +12,9 @@ import * as Types from "../actions/types";
1212import {
1313 GetDataFromServerToPatch ,
1414 GetDataFromServer ,
15- deleteService
15+ deleteService ,
1616} from "../service" ;
17- import {
18- message
19- } from "antd" ;
17+ import { message } from "antd" ;
2018
2119const baseUrl = "https://mern-article.herokuapp.com" ;
2220//const baseUrl = "http://localhost:5000";
@@ -303,22 +301,27 @@ function* editProfile(action) {
303301 let formBody = { } ;
304302 formBody = action . userProfile ;
305303 const postUrl = baseUrl + "/user/" + action . user_id ;
306- const response = yield call ( GetDataFromServerToPatch , postUrl , "PATCH" , formBody )
307- const result = yield response . json ( )
304+ const response = yield call (
305+ GetDataFromServerToPatch ,
306+ postUrl ,
307+ "PATCH" ,
308+ formBody
309+ ) ;
310+ const result = yield response . json ( ) ;
308311
309312 if ( result . error ) {
310313 yield put ( {
311314 type : Types . USER_PROFILE_EDIT_SERVER_RESPONSE_ERROR ,
312- error : result . error
313- } )
315+ error : result . error ,
316+ } ) ;
314317 } else {
315318 yield put ( {
316319 type : Types . USER_PROFILE_EDIT_SERVER_RESPONSE_SUCCESS ,
317- result
318- } )
320+ result,
321+ } ) ;
319322 }
320323 } catch ( error ) {
321- message: error
324+ message: error ;
322325 }
323326}
324327
@@ -647,6 +650,6 @@ export default function* rootSaga(params) {
647650 yield takeEvery ( Types . GET_ARTICLE_LIKES , getArticleLikes ) ;
648651 yield takeEvery ( Types . DELETE_LIKE_ARTICLE , deleteArticleLike ) ;
649652 yield takeEvery ( Types . GET_ARTICLES_LIKED , getArticlesLiked ) ;
650- yield takeEvery ( Types . USER_PROFILE_EDIT , editProfile )
653+ yield takeEvery ( Types . USER_PROFILE_EDIT , editProfile ) ;
651654 console . log ( "ROOT SAGA" ) ;
652- }
655+ }
0 commit comments