summaryrefslogtreecommitdiffstats
path: root/webapp/actions/user_actions.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/actions/user_actions.jsx')
-rw-r--r--webapp/actions/user_actions.jsx62
1 files changed, 40 insertions, 22 deletions
diff --git a/webapp/actions/user_actions.jsx b/webapp/actions/user_actions.jsx
index 3b1fa96a8..b9d4ec376 100644
--- a/webapp/actions/user_actions.jsx
+++ b/webapp/actions/user_actions.jsx
@@ -133,6 +133,29 @@ export function loadTeamMembersForProfilesList(profiles, teamId = TeamStore.getC
loadTeamMembersForProfiles(list, teamId, success, error);
}
+export function loadProfilesWithoutTeam(page, perPage, success, error) {
+ Client.getProfilesWithoutTeam(
+ page,
+ perPage,
+ (data) => {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_PROFILES_WITHOUT_TEAM,
+ profiles: data,
+ page
+ });
+
+ loadStatusesForProfilesMap(data);
+ },
+ (err) => {
+ AsyncClient.dispatchError(err, 'getProfilesWithoutTeam');
+
+ if (error) {
+ error(err);
+ }
+ }
+ );
+}
+
function loadTeamMembersForProfiles(userIds, teamId, success, error) {
Client.getTeamMembersByIds(
teamId,
@@ -580,20 +603,16 @@ export function updateUserNotifyProps(data, success, error) {
export function updateUserRoles(userId, newRoles, success, error) {
Client.updateUserRoles(
- userId,
- newRoles,
- () => {
- AsyncClient.getUser(userId);
-
- if (success) {
- success();
- }
- },
- (err) => {
- if (error) {
- error(err);
- }
- }
+ userId,
+ newRoles,
+ () => {
+ AsyncClient.getUser(
+ userId,
+ success,
+ error
+ );
+ },
+ error
);
}
@@ -658,18 +677,17 @@ export function checkMfa(loginId, success, error) {
export function updateActive(userId, active, success, error) {
Client.updateActive(userId, active,
- () => {
- AsyncClient.getUser(userId);
+ (data) => {
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_PROFILE,
+ profile: data
+ });
if (success) {
- success();
+ success(data);
}
},
- (err) => {
- if (error) {
- error(err);
- }
- }
+ error
);
}