Skip to content

Commit

Permalink
Merge pull request #341 from weMail/feature/team-redesign
Browse files Browse the repository at this point in the history
Update new url for team feature.
  • Loading branch information
sumaisa-mou authored Oct 23, 2023
2 parents 157174f + 545a67f commit 9e118ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion includes/Core/Auth/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function site( $api = '' ) {
'include' => 'role,permissions',
];

$wp_admin_response = wemail()->api->auth()->users()->post( $data );
$wp_admin_response = wemail()->api->teamUsers()->post( $data );

if ( ! empty( $wp_admin_response['access_token'] ) ) {
$user_meta = [
Expand Down
2 changes: 1 addition & 1 deletion includes/Core/User/Integrations/WpUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected function check_role( $roles, $role ) {
* @param string $role
*/
protected function create_wemail_user( $user, $role ) {
$response = wemail()->api->auth()->users()->post(
$response = wemail()->api->teamUsers()->post(
[
'name' => $user->data->display_name,
'email' => $user->data->user_email,
Expand Down
15 changes: 6 additions & 9 deletions includes/Rest/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function store( $request ) {
wemail()->api->set_api_key( $access_token[0] );

foreach ( $users as $user ) {
$wp_admin_response = wemail()->api->auth()->users()->post(
$wp_admin_response = wemail()->api->teamUsers()->post(
[
'name' => $user['name'],
'email' => $user['email'],
Expand Down Expand Up @@ -136,7 +136,7 @@ public function toggleStatus( $request ) {
$status = $request->get_param( 'status' );
$user = get_user_by( 'email', $email );
if ( $user ) {
$wp_admin_response = wemail()->api->auth()->users()->status()->post(
$wp_admin_response = wemail()->api->team()->users()->status()->post(
[
'email' => $email,
'status' => $status,
Expand Down Expand Up @@ -173,13 +173,10 @@ public function roles() {
$available_roles = [];
foreach ( $roles->roles as $key => $role ) {
if ( $key !== 'subscriber' ) {
array_push(
$available_roles,
[
'slug' => $key,
'name' => $role['name'],
]
);
$available_roles[] = [
'slug' => $key,
'name' => $role['name'],
];
}
}

Expand Down

0 comments on commit 9e118ae

Please sign in to comment.