번호 자동 부여 대응 및 API 공통 처리 보강
This commit is contained in:
@@ -47,8 +47,7 @@ class CustomerRepositoryRemote implements CustomerRepository {
|
||||
query: {if (includeZipcode) 'include': 'zipcode'},
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? {};
|
||||
return CustomerDto.fromJson(data).toEntity();
|
||||
return CustomerDto.fromJson(_api.unwrapAsMap(response)).toEntity();
|
||||
}
|
||||
|
||||
/// 고객을 생성한다.
|
||||
@@ -59,8 +58,7 @@ class CustomerRepositoryRemote implements CustomerRepository {
|
||||
data: customerInputToJson(input),
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? {};
|
||||
return CustomerDto.fromJson(data).toEntity();
|
||||
return CustomerDto.fromJson(_api.unwrapAsMap(response)).toEntity();
|
||||
}
|
||||
|
||||
/// 고객 정보를 수정한다.
|
||||
@@ -72,8 +70,7 @@ class CustomerRepositoryRemote implements CustomerRepository {
|
||||
data: payload,
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? {};
|
||||
return CustomerDto.fromJson(data).toEntity();
|
||||
return CustomerDto.fromJson(_api.unwrapAsMap(response)).toEntity();
|
||||
}
|
||||
|
||||
/// 고객을 삭제한다.
|
||||
@@ -89,7 +86,6 @@ class CustomerRepositoryRemote implements CustomerRepository {
|
||||
'$_basePath/$id/restore',
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? {};
|
||||
return CustomerDto.fromJson(data).toEntity();
|
||||
return CustomerDto.fromJson(_api.unwrapAsMap(response)).toEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ class _CustomerEnabledPageState extends State<_CustomerEnabledPage> {
|
||||
final currentPage = result?.page ?? 1;
|
||||
final totalPages = result == null || result.pageSize == 0
|
||||
? 1
|
||||
: (result.total / result.pageSize).ceil().clamp(1, 9999) as int;
|
||||
: (result.total / result.pageSize).ceil().clamp(1, 9999);
|
||||
final hasNext = result == null
|
||||
? false
|
||||
: (result.page * result.pageSize) < result.total;
|
||||
|
||||
Reference in New Issue
Block a user