번호 자동 부여 대응 및 API 공통 처리 보강
This commit is contained in:
@@ -33,13 +33,10 @@ class ApprovalStepRepositoryRemote implements ApprovalStepRepository {
|
||||
'page': page,
|
||||
'page_size': pageSize,
|
||||
if (query != null && query.isNotEmpty) 'q': query,
|
||||
if (statusId != null) ...{
|
||||
'status_id': statusId,
|
||||
'step_status_id': statusId,
|
||||
},
|
||||
if (statusId != null) ...{'status_id': statusId},
|
||||
if (approverId != null) 'approver_id': approverId,
|
||||
if (approvalId != null) 'approval_id': approvalId,
|
||||
'include': 'approval,approver,step_status',
|
||||
'include': 'approval,approver,status',
|
||||
},
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
@@ -54,8 +51,9 @@ class ApprovalStepRepositoryRemote implements ApprovalStepRepository {
|
||||
'$_basePath/$id',
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final data = (response.data?['data'] as Map<String, dynamic>?) ?? const {};
|
||||
return ApprovalStepRecordDto.fromJson(data).toEntity();
|
||||
return ApprovalStepRecordDto.fromJson(
|
||||
_api.unwrapAsMap(response),
|
||||
).toEntity();
|
||||
}
|
||||
|
||||
/// 결재 단계를 생성한다.
|
||||
@@ -66,11 +64,9 @@ class ApprovalStepRepositoryRemote implements ApprovalStepRepository {
|
||||
data: input.toPayload(),
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final raw = response.data;
|
||||
final data =
|
||||
(raw?['data'] as Map<String, dynamic>?) ??
|
||||
(raw is Map<String, dynamic> ? raw : const <String, dynamic>{});
|
||||
return ApprovalStepRecordDto.fromJson(data).toEntity();
|
||||
return ApprovalStepRecordDto.fromJson(
|
||||
_api.unwrapAsMap(response),
|
||||
).toEntity();
|
||||
}
|
||||
|
||||
/// 결재 단계를 수정한다.
|
||||
@@ -81,11 +77,9 @@ class ApprovalStepRepositoryRemote implements ApprovalStepRepository {
|
||||
data: input.toPayload(),
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final raw = response.data;
|
||||
final data =
|
||||
(raw?['data'] as Map<String, dynamic>?) ??
|
||||
(raw is Map<String, dynamic> ? raw : const <String, dynamic>{});
|
||||
return ApprovalStepRecordDto.fromJson(data).toEntity();
|
||||
return ApprovalStepRecordDto.fromJson(
|
||||
_api.unwrapAsMap(response),
|
||||
).toEntity();
|
||||
}
|
||||
|
||||
/// 결재 단계를 비활성화한다.
|
||||
@@ -101,10 +95,8 @@ class ApprovalStepRepositoryRemote implements ApprovalStepRepository {
|
||||
'$_basePath/$id/restore',
|
||||
options: Options(responseType: ResponseType.json),
|
||||
);
|
||||
final raw = response.data;
|
||||
final data =
|
||||
(raw?['data'] as Map<String, dynamic>?) ??
|
||||
(raw is Map<String, dynamic> ? raw : const <String, dynamic>{});
|
||||
return ApprovalStepRecordDto.fromJson(data).toEntity();
|
||||
return ApprovalStepRecordDto.fromJson(
|
||||
_api.unwrapAsMap(response),
|
||||
).toEntity();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user