fix phone dashboard

This commit is contained in:
root
2026-05-27 03:11:45 -04:00
parent 7ca43ba2f3
commit 1112b04516
48 changed files with 1222 additions and 368 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ class CustomerService {
'pageSize': pageSize,
if (search != null && search.isNotEmpty) 'search': search,
});
return CustomerListResponse.fromJson(res.data as Map<String, dynamic>);
return CustomerListResponse.fromApi(res.data);
}
Future<Customer> getCustomer(String id) async {
+1 -1
View File
@@ -52,7 +52,7 @@ class ReservationService {
if (search != null && search.isNotEmpty) 'search': search,
'customerId': ?customerId,
});
return ReservationListResponse.fromJson(res.data as Map<String, dynamic>);
return ReservationListResponse.fromApi(res.data);
}
Future<Reservation> getReservation(String id) async {
+6 -7
View File
@@ -71,15 +71,14 @@ class VehicleService {
int page = 1,
int pageSize = 20,
String? status,
String? search,
}) async {
final res = await _client.get('/vehicles', params: {
'page': page,
'pageSize': pageSize,
final params = <String, dynamic>{
if (page != 1) 'page': page,
if (pageSize != 20) 'pageSize': pageSize,
'status': ?status,
if (search != null && search.isNotEmpty) 'search': search,
});
return VehicleListResponse.fromJson(res.data as Map<String, dynamic>);
};
final res = await _client.get('/vehicles', params: params);
return VehicleListResponse.fromApi(res.data);
}
Future<Vehicle> getVehicle(String id) async {