Browse Source

fix Bug #7910

master
daivph 5 years ago
parent
commit
2daf6b6085
3 changed files with 9 additions and 6 deletions
  1. +1
    -1
      lib/data/api/rest_client.dart
  2. +1
    -1
      lib/data/api/rest_client.g.dart
  3. +7
    -4
      lib/data/repository/repository.dart

+ 1
- 1
lib/data/api/rest_client.dart View File

@@ -77,7 +77,7 @@ abstract class RestClient {
@GET("/api/tb-countries?page={page}&size={size}&&sort=name,ASC")
Future<List<LocationUnit>> getCountries(
{@Path() int page = 0,
@Path() int size = 20,
@Path() int size = 400,
@DioOptions() Options options});

@GET(

+ 1
- 1
lib/data/api/rest_client.g.dart View File

@@ -319,7 +319,7 @@ class _RestClient implements RestClient {
}

@override
getCountries({page = 0, size = 20, options}) async {
getCountries({page = 0, size = 400, options}) async {
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
queryParameters.removeWhere((k, v) => v == null);

+ 7
- 4
lib/data/repository/repository.dart View File

@@ -120,20 +120,23 @@ class Repository {
{@required LocationType locationType,
int filterId,
int page = 0,
int size = 100}) {
int size = 500}) {
final client = RestClient(dio);
var op = buildConfigurableCacheOptions(
forceRefresh: true, maxAge: Duration(days: ConstCommon.kMaxAgeCache));
var response;
switch (locationType) {
case LocationType.province:
response = client.getProvinces(filterId, options: op);
response =
client.getProvinces(filterId, options: op, page: page, size: size);
break;
case LocationType.district:
response = client.getDistricts(filterId, options: op);
response =
client.getDistricts(filterId, options: op, page: page, size: size);
break;
case LocationType.ward:
response = client.getWards(filterId, options: op);
response =
client.getWards(filterId, options: op, page: page, size: size);
break;
default:
response = client.getCountries();

Loading…
Cancel
Save