feat: 결재·마스터 실연동 업데이트
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:superport_v2/core/common/models/paginated_result.dart';
|
||||
import 'package:superport_v2/core/network/api_client.dart';
|
||||
import 'package:superport_v2/core/network/api_routes.dart';
|
||||
|
||||
import '../../domain/entities/group.dart';
|
||||
import '../../domain/repositories/group_repository.dart';
|
||||
@@ -12,7 +13,7 @@ class GroupRepositoryRemote implements GroupRepository {
|
||||
|
||||
final ApiClient _api;
|
||||
|
||||
static const _basePath = '/groups';
|
||||
static const _basePath = '${ApiRoutes.apiV1}/groups';
|
||||
|
||||
/// 그룹 목록을 조회한다.
|
||||
@override
|
||||
@@ -22,7 +23,16 @@ class GroupRepositoryRemote implements GroupRepository {
|
||||
String? query,
|
||||
bool? isDefault,
|
||||
bool? isActive,
|
||||
bool includePermissions = false,
|
||||
bool includeEmployees = false,
|
||||
}) async {
|
||||
final includeParts = <String>[];
|
||||
if (includePermissions) {
|
||||
includeParts.add('permissions');
|
||||
}
|
||||
if (includeEmployees) {
|
||||
includeParts.add('employees');
|
||||
}
|
||||
final response = await _api.get<Map<String, dynamic>>(
|
||||
_basePath,
|
||||
query: {
|
||||
@@ -31,6 +41,7 @@ class GroupRepositoryRemote implements GroupRepository {
|
||||
if (query != null && query.isNotEmpty) 'q': query,
|
||||
if (isDefault != null) 'is_default': isDefault,
|
||||
if (isActive != null) 'is_active': isActive,
|
||||
if (includeParts.isNotEmpty) 'include': includeParts.join(','),
|
||||
},
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user