Skip to content

Commit 4987249

Browse files
committed
v3.2.0 updates
1 parent 06968d1 commit 4987249

37 files changed

+150
-56
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## [3.2.0] - 2022-07-07
2+
3+
* New API to delete an account
4+
* Update code docs
5+
16
## [3.1.3] - 2021-09-03
27

38
* Add roles to wp_user_info_response

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 2-Clause License
22

3-
Copyright (c) 2021, WooSignal Ltd
3+
Copyright (c) 2022, WooSignal Ltd
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Update Users Password
1414
* Add role to a user
1515
* Remove role from a user
16+
* Delete a user
1617

1718
**WooCommerce**
1819

@@ -27,7 +28,7 @@ In your flutter project add the dependency:
2728
``` dart
2829
dependencies:
2930
...
30-
wp_json_api: ^3.1.3
31+
wp_json_api: ^3.2.0
3132
```
3233

3334
### Usage example #
@@ -179,6 +180,18 @@ WPUserRemoveRoleResponse wpUserRemoveRoleResponse = await WPJsonAPI.instance
179180
));
180181
```
181182

183+
#### WordPress - Delete a user
184+
- Used to delete a user in WordPress
185+
- The first parameter is the **userToken** which is returned from the login/register response. You should have this saved somewhere e.g. shared_pref
186+
- You can pass an optional argument 'reassign' to reassign posts and links to new User ID.
187+
188+
``` dart
189+
WPUserDeleteResponse wpUserDeleteResponse = await WPJsonAPI.instance
190+
.api((request) => request.wpUserDelete(
191+
userToken
192+
));
193+
```
194+
182195
#### WooCommerce - Get users info in WooCommerce
183196
- Used to get WooCommerce info for a given user
184197
- The first parameter is the **userToken** which is returned from the login/register response. You should have this saved somewhere e.g. shared_pref

lib/enums/wp_auth_type.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/enums/wp_meta_data_action_type.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/enums/wp_route_type.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted
@@ -42,6 +42,10 @@ enum WPRouteType {
4242
/// For WordPress
4343
UserLogin,
4444

45+
/// Route type [WPRouteType.UserDelete] is used to delete a user from WordPress.
46+
/// For WordPress
47+
UserDelete,
48+
4549
/// Route type [WPRouteType.AuthNonce] is used to get a nonce token to authenticate future API requests.
4650
/// For WordPress
4751
AuthNonce,

lib/exceptions/empty_username_exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/exceptions/existing_user_email_exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/exceptions/existing_user_login_exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

lib/exceptions/incorrect_password_exception.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2021, WooSignal Ltd.
1+
// Copyright (c) 2022, WooSignal Ltd.
22
// All rights reserved.
33
//
44
// Redistribution and use in source and binary forms are permitted

0 commit comments

Comments
 (0)