@@ -7,12 +7,6 @@ import {
7
7
select ,
8
8
takeEvery ,
9
9
} from 'redux-saga/effects'
10
- import {
11
- getMappingResponse ,
12
- updatePermissionsServerResponse ,
13
- updatePermissionsLoading ,
14
- getMapping ,
15
- } from '../actions/MappingActions'
16
10
import { API_USERS } from '../audit/Resources'
17
11
import { FETCH } from '../../../../app/audit/UserActionType'
18
12
import { getAPIAccessToken } from '../../../../app/redux/actions/AuthActions'
@@ -23,10 +17,10 @@ import {
23
17
import { UM_GET_USERS } from '../actions/types'
24
18
import UserApi from '../api/UserApi'
25
19
import { getClient } from '../../../../app/redux/api/base'
26
- import { postUserAction } from '../../../../app/redux/api/backend-api'
27
20
const JansConfigApi = require ( 'jans_config_api' )
28
21
import { initAudit } from '../../../../app/redux/sagas/SagaUtils'
29
-
22
+ import { updateUserResponse } from '../actions/UserActions'
23
+ import { postUserAction } from '../../../../app/redux/api/backend-api'
30
24
function * newFunction ( ) {
31
25
const token = yield select ( ( state ) => state . authReducer . token . access_token )
32
26
const issuer = yield select ( ( state ) => state . authReducer . issuer )
@@ -41,10 +35,12 @@ export function* getUsersSaga({ payload }) {
41
35
try {
42
36
addAdditionalData ( audit , FETCH , API_USERS , payload )
43
37
const userApi = yield * newFunction ( )
44
- const data = yield call ( userApi . getUsers )
38
+ console . log ( 'Called' )
39
+ const data = yield call ( userApi . getUsers , payload )
40
+ yield put ( updateUserResponse ( data ) )
45
41
console . log ( data )
46
42
// yield put(getMappingResponse(data))
47
- // yield call(postUserAction, audit)
43
+ yield call ( postUserAction , audit )
48
44
} catch ( e ) {
49
45
console . log ( e )
50
46
// yield put(getMappingResponse(null))
@@ -56,7 +52,7 @@ export function* getUsersSaga({ payload }) {
56
52
}
57
53
58
54
export function * watchGetUsers ( ) {
59
- yield takeLatest ( UM_GET_USERS , getUsersSaga )
55
+ yield takeEvery ( UM_GET_USERS , getUsersSaga )
60
56
}
61
57
62
58
export default function * rootSaga ( ) {
0 commit comments