feat: sync auth to new api

This commit is contained in:
efrilm
2025-08-02 23:10:48 +07:00
parent bd7e925306
commit 576f687d21
7 changed files with 162 additions and 85 deletions
@@ -52,7 +52,7 @@ class OrderBloc extends Bloc<OrderEvent, OrderState> {
total: event.totalPriceFinal,
paymentMethod: event.paymentMethod,
totalItem: totalItem,
idKasir: userData.user?.id ?? 1,
idKasir: int.parse(userData.user!.id ?? "0"),
namaKasir: userData.user?.name ?? 'Kasir A',
transactionTime: DateTime.now().toIso8601String(),
customerName: event.customerName,
@@ -66,11 +66,11 @@ class OrderBloc extends Bloc<OrderEvent, OrderState> {
log("Start 2");
//check state online or offline
log("🔄 About to call API to save order...");
log("📤 Order data being sent to API: ${dataInput.toServerMap()}");
log("🌐 OrderRemoteDatasource instance: $orderRemoteDatasource");
bool value = false;
try {
value = await orderRemoteDatasource.saveOrder(dataInput);