v1.1.27 deactivate customer
This commit is contained in:
@@ -92,6 +92,8 @@ class APIClient with Common, Logging {
|
||||
} else {
|
||||
throw Exception("Network Error, please try again later");
|
||||
}
|
||||
} on NotFoundException catch(e) {
|
||||
throw NotFoundException(message: "Not Found");
|
||||
} on Exception catch (e) {
|
||||
print("Post Exception: $e");
|
||||
await Sentry.captureException(e);
|
||||
@@ -128,6 +130,8 @@ class APIClient with Common, Logging {
|
||||
} else {
|
||||
throw Exception("Network Error, please try again later");
|
||||
}
|
||||
} on NotFoundException catch(e) {
|
||||
throw NotFoundException(message: "Not Found");
|
||||
} on Exception catch (e) {
|
||||
print("Post Exception: $e");
|
||||
await Sentry.captureException(e);
|
||||
|
||||
@@ -32,6 +32,11 @@ class CustomerApi with Logging {
|
||||
await _client.post("customers/update_firebase_uid/" + customerId.toString(), uid);
|
||||
}
|
||||
|
||||
Future<void> deactivateCustomer(int customerId) async {
|
||||
log(" ===== deactivate : $customerId");
|
||||
await _client.post("customers/deactivate/$customerId", "");
|
||||
}
|
||||
|
||||
Future<void> addCustomer(Customer customer) async {
|
||||
customer.dateAdd = DateTime.now();
|
||||
customer.dateChange = DateTime.now();
|
||||
@@ -80,7 +85,7 @@ class CustomerApi with Logging {
|
||||
final String responseBody = await _client.get("customers/find_by_email/" + email, "");
|
||||
Customer customer;
|
||||
try {
|
||||
customer = Customer.fromJson(jsonDecode(responseBody));
|
||||
customer = Customer.fromJson(jsonDecode(responseBody));
|
||||
if (customer.firebaseUid == null) {
|
||||
await this.updateFirebaseUid(customer.customerId!, Cache().firebaseUid!);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user