-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create linked learners when assigning codes (#506)
- Loading branch information
Lael Birch
authored
Mar 19, 2021
1 parent
0c73558
commit 37e853f
Showing
5 changed files
with
95 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { | ||
PENDING_ENT_USER_REQUEST, | ||
PENDING_ENT_USER_SUCCESS, | ||
PENDING_ENT_USER_FAILURE, | ||
} from '../constants/createPendingEntUser'; | ||
|
||
import LmsApiService from '../services/LmsApiService'; | ||
|
||
const createPendingUsersRequest = () => ({ | ||
type: PENDING_ENT_USER_REQUEST, | ||
}); | ||
|
||
const createPendingUsersSuccess = data => ({ | ||
type: PENDING_ENT_USER_SUCCESS, | ||
payload: { | ||
data, | ||
}, | ||
}); | ||
|
||
const createPendingUsersFailure = error => ({ | ||
type: PENDING_ENT_USER_FAILURE, | ||
payload: { | ||
error, | ||
}, | ||
}); | ||
|
||
const createPendingEnterpriseUsers = ({ | ||
users, | ||
onSuccess = () => {}, | ||
onError = () => {}, | ||
}) => ( | ||
(dispatch) => { | ||
dispatch(createPendingUsersRequest()); | ||
return LmsApiService.createPendingEnterpriseUsers(users) | ||
.then((response) => { | ||
dispatch(createPendingUsersSuccess(response.data)); | ||
onSuccess(response.data); | ||
}) | ||
.catch((error) => { | ||
dispatch(createPendingUsersFailure(error)); | ||
onError(error); | ||
}); | ||
} | ||
); | ||
|
||
export default createPendingEnterpriseUsers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const PENDING_ENT_USER_REQUEST = 'PENDING_ENT_USER_REQUEST'; | ||
const PENDING_ENT_USER_SUCCESS = 'PENDING_ENT_USER_SUCCESS'; | ||
const PENDING_ENT_USER_FAILURE = 'PENDING_ENT_USER_FAILURE'; | ||
|
||
export { | ||
PENDING_ENT_USER_REQUEST, | ||
PENDING_ENT_USER_SUCCESS, | ||
PENDING_ENT_USER_FAILURE, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters