계정 정보 다이얼로그 추가 및 전체 목록 페치 개선
This commit is contained in:
@@ -43,6 +43,17 @@ class ApprovalHistoryController extends ChangeNotifier {
|
||||
_errorMessage = null;
|
||||
notifyListeners();
|
||||
try {
|
||||
final previous = _result;
|
||||
final int resolvedPage;
|
||||
if (page < 1) {
|
||||
resolvedPage = 1;
|
||||
} else if (previous != null && previous.pageSize > 0) {
|
||||
final calculated = (previous.total / previous.pageSize).ceil();
|
||||
final maxPage = calculated < 1 ? 1 : calculated;
|
||||
resolvedPage = page > maxPage ? maxPage : page;
|
||||
} else {
|
||||
resolvedPage = page;
|
||||
}
|
||||
final action = switch (_actionFilter) {
|
||||
ApprovalHistoryActionFilter.all => null,
|
||||
ApprovalHistoryActionFilter.approve => 'approve',
|
||||
@@ -51,7 +62,7 @@ class ApprovalHistoryController extends ChangeNotifier {
|
||||
};
|
||||
|
||||
final response = await _repository.list(
|
||||
page: page,
|
||||
page: resolvedPage,
|
||||
pageSize: _pageSize,
|
||||
query: _query.trim().isEmpty ? null : _query.trim(),
|
||||
action: action,
|
||||
|
||||
Reference in New Issue
Block a user