Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update new url for team feature. #341

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading