client/src/sagas/groupSaga.js
changeset 135 b5aafa462956
parent 134 be36eed5e6e0
--- a/client/src/sagas/groupSaga.js	Thu Aug 03 17:33:00 2017 +0200
+++ b/client/src/sagas/groupSaga.js	Thu Aug 03 19:11:06 2017 +0200
@@ -1,7 +1,6 @@
 import { put, take, all } from 'redux-saga/effects'
 import * as types from '../constants/actionTypes';
 import { groupCreateSuccess, groupCreateError, groupLoadSucess, groupLoadError } from '../actions/groupActions';
-import { updateSession } from '../actions/sessionsActions';
 
 function* watchCreateGroup(context) {
   while (true) {
@@ -17,25 +16,6 @@
   }
 }
 
-function* watchCreateGroupAndUpdateSession(context) {
-  while (true) {
-    const { session, group } = yield take(types.GROUP_CREATE_AND_UPDATE_ASYNC);
-    const client = context.client;
-    try {
-      const response = yield client.post('/api/auth/group/', group);
-
-      const actions = [
-        groupCreateSuccess(response),
-        updateSession(session, {group: response.name, protocol: response.protocol})
-      ];
-      yield all(actions.map(action => put(action)));
-
-    } catch (e) {
-      yield put(groupCreateError(e));
-    }
-  }
-}
-
 function* watchLoadGroups(context) {
   const client = context.client;
   while (true) {
@@ -52,7 +32,6 @@
 export default function* rootSaga(context) {
   yield all([
     watchCreateGroup(context),
-    watchCreateGroupAndUpdateSession(context),
     watchLoadGroups(context),
   ])
 }