|
|
@ -77,10 +77,9 @@ export class IdentityState { |
|
|
|
|
|
|
|
|
@Action(UpdateRole) |
|
|
@Action(UpdateRole) |
|
|
updateRole({ getState, dispatch }: StateContext<Identity.State>, { payload }: UpdateRole) { |
|
|
updateRole({ getState, dispatch }: StateContext<Identity.State>, { payload }: UpdateRole) { |
|
|
return dispatch(new GetRoleById(payload.id)).pipe( |
|
|
return this.identityService |
|
|
switchMap(() => this.identityService.updateRole({ ...getState().selectedRole, ...payload })), |
|
|
.updateRole({ ...getState().selectedRole, ...payload }) |
|
|
switchMap(() => dispatch(new GetRoles())), |
|
|
.pipe(switchMap(() => dispatch(new GetRoles()))); |
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Action(GetUsers) |
|
|
@Action(GetUsers) |
|
|
@ -117,10 +116,9 @@ export class IdentityState { |
|
|
|
|
|
|
|
|
@Action(UpdateUser) |
|
|
@Action(UpdateUser) |
|
|
updateUser({ getState, dispatch }: StateContext<Identity.State>, { payload }: UpdateUser) { |
|
|
updateUser({ getState, dispatch }: StateContext<Identity.State>, { payload }: UpdateUser) { |
|
|
return dispatch(new GetUserById(payload.id)).pipe( |
|
|
return this.identityService |
|
|
switchMap(() => this.identityService.updateUser({ ...getState().selectedUser, ...payload })), |
|
|
.updateUser({ ...getState().selectedUser, ...payload }) |
|
|
switchMap(() => dispatch(new GetUsers())), |
|
|
.pipe(switchMap(() => dispatch(new GetUsers()))); |
|
|
); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Action(GetUserRoles) |
|
|
@Action(GetUserRoles) |
|
|
|