@@ -11,6 +11,7 @@ import {
11
11
deleteLdapResponse ,
12
12
testLdapResponse ,
13
13
} from '../actions/LdapActions'
14
+ import { updateToast } from 'Redux/actions/ToastAction'
14
15
import { getAPIAccessToken } from 'Redux/actions/AuthActions'
15
16
import { LDAP } from '../audit/Resources'
16
17
import {
@@ -63,9 +64,11 @@ export function* addLdap({ payload }) {
63
64
addAdditionalData ( audit , CREATE , LDAP , payload )
64
65
const api = yield * newFunction ( )
65
66
const data = yield call ( api . addLdapConfig , payload . data . action_data )
67
+ yield put ( updateToast ( true , 'success' ) )
66
68
yield put ( addLdapResponse ( data ) )
67
69
yield call ( postUserAction , audit )
68
70
} catch ( e ) {
71
+ yield put ( updateToast ( true , 'error' ) )
69
72
yield put ( addLdapResponse ( null ) )
70
73
if ( isFourZeroOneError ( e ) ) {
71
74
const jwt = yield select ( ( state ) => state . authReducer . userinfo_jwt )
@@ -80,9 +83,11 @@ export function* editLdap({ payload }) {
80
83
addAdditionalData ( audit , UPDATE , LDAP , payload )
81
84
const api = yield * newFunction ( )
82
85
const data = yield call ( api . updateLdapConfig , payload . data . action_data )
86
+ yield put ( updateToast ( true , 'success' ) )
83
87
yield put ( editLdapResponse ( data ) )
84
88
yield call ( postUserAction , audit )
85
89
} catch ( e ) {
90
+ yield put ( updateToast ( true , 'error' ) )
86
91
console . log ( e )
87
92
yield put ( editLdapResponse ( null ) )
88
93
if ( isFourZeroOneError ( e ) ) {
@@ -99,9 +104,11 @@ export function* deleteLdap({ payload }) {
99
104
addAdditionalData ( audit , DELETION , LDAP , payload )
100
105
const api = yield * newFunction ( )
101
106
yield call ( api . deleteLdapConfig , payload . configId )
107
+ yield put ( updateToast ( true , 'success' ) )
102
108
yield put ( deleteLdapResponse ( payload . configId ) )
103
109
yield call ( postUserAction , audit )
104
110
} catch ( e ) {
111
+ yield put ( updateToast ( true , 'error' ) )
105
112
yield put ( deleteLdapResponse ( null ) )
106
113
if ( isFourZeroOneError ( e ) ) {
107
114
const jwt = yield select ( ( state ) => state . authReducer . userinfo_jwt )
0 commit comments