v1.1.27 deactivate customer

This commit is contained in:
Tibor Bossanyi (Freelancer)
2022-11-26 16:46:06 +01:00
parent dbdcf2f239
commit 98901f2770
10 changed files with 116 additions and 9 deletions
+4
View File
@@ -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);
+6 -1
View File
@@ -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!);
}