Update project
This commit is contained in:
@@ -7,6 +7,7 @@ import '../../modules/orders/create_order.dart';
|
||||
class OrderController extends GetxController {
|
||||
final CreateOrderProvider provider = CreateOrderProvider();
|
||||
var isLoading = false.obs;
|
||||
String? lastError; // 👈 add this
|
||||
|
||||
Future<CreateOrderResponse?> createOrder(CreateOrderRequest request) async {
|
||||
try {
|
||||
@@ -17,20 +18,19 @@ class OrderController extends GetxController {
|
||||
isLoading.value = false;
|
||||
|
||||
if (response.status == 'accepted') {
|
||||
|
||||
print(response.status);
|
||||
|
||||
print("✅ Order Success");
|
||||
} else {
|
||||
print("❌ Order Failed");
|
||||
}
|
||||
|
||||
return response; // ✅ VERY IMPORTANT
|
||||
return response;
|
||||
} catch (e) {
|
||||
isLoading.value = false;
|
||||
|
||||
print("🔥 ERROR: $e");
|
||||
print("🔥 ERROR: $e"); // already printing e here
|
||||
print("🔥 ERROR TYPE: ${e.runtimeType}"); // 👈 add this to see the exact class
|
||||
|
||||
return null; // ✅ return null on error
|
||||
return null;
|
||||
}
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user