import '../../constant/box_name.dart';
import '../../constant/links.dart';
import '../../main.dart';
import 'crud.dart';

addError(String error, where) async {
  CRUD().post(link: AppLink.addError, payload: {
    'error': error.toString(), // Example error description
    'userId': box.read(BoxName.driverID) ??
        box.read(BoxName.passengerID), // Example user ID
    'userType': box.read(BoxName.driverID) != null
        ? 'Driver'
        : 'passenger', // Example user type
    'phone': box.read(BoxName.phone) ??
        box.read(BoxName.phoneDriver), // Example phone number

    'device': where
  });
}
