번호 자동 부여 대응 및 API 공통 처리 보강
This commit is contained in:
@@ -34,7 +34,7 @@ class GroupPermissionRepositoryRemote implements GroupPermissionRepository {
|
||||
if (groupId != null) 'group_id': groupId,
|
||||
if (menuId != null) 'menu_id': menuId,
|
||||
if (isActive != null) 'active': isActive,
|
||||
if (includeDeleted) 'deleted': true,
|
||||
if (includeDeleted) 'include_deleted': true,
|
||||
'include': 'group,menu',
|
||||
},
|
||||
options: Options(responseType: ResponseType.json),
|
||||
@@ -50,8 +50,7 @@ class GroupPermissionRepositoryRemote implements GroupPermissionRepository {
|
||||
data: input.toPayload(),
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? {};
|
||||
return GroupPermissionDto.fromJson(data).toEntity();
|
||||
return GroupPermissionDto.fromJson(_api.unwrapAsMap(response)).toEntity();
|
||||
}
|
||||
|
||||
/// 그룹 권한을 수정한다.
|
||||
@@ -63,8 +62,7 @@ class GroupPermissionRepositoryRemote implements GroupPermissionRepository {
|
||||
data: payload,
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? {};
|
||||
return GroupPermissionDto.fromJson(data).toEntity();
|
||||
return GroupPermissionDto.fromJson(_api.unwrapAsMap(response)).toEntity();
|
||||
}
|
||||
|
||||
/// 그룹 권한을 삭제한다.
|
||||
@@ -80,7 +78,6 @@ class GroupPermissionRepositoryRemote implements GroupPermissionRepository {
|
||||
'$_basePath/$id/restore',
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? {};
|
||||
return GroupPermissionDto.fromJson(data).toEntity();
|
||||
return GroupPermissionDto.fromJson(_api.unwrapAsMap(response)).toEntity();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class _GroupPermissionEnabledPageState
|
||||
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;
|
||||
@@ -856,6 +856,7 @@ class _PermissionTable extends StatelessWidget {
|
||||
'ID',
|
||||
'그룹명',
|
||||
'메뉴명',
|
||||
'라우트 경로',
|
||||
'생성',
|
||||
'조회',
|
||||
'수정',
|
||||
@@ -872,6 +873,7 @@ class _PermissionTable extends StatelessWidget {
|
||||
permission.id?.toString() ?? '-',
|
||||
permission.group.groupName,
|
||||
permission.menu.menuName,
|
||||
permission.menu.path ?? '-',
|
||||
permission.canCreate ? 'Y' : '-',
|
||||
permission.canRead ? 'Y' : '-',
|
||||
permission.canUpdate ? 'Y' : '-',
|
||||
|
||||
Reference in New Issue
Block a user