TF-4178 Add datasource/repository/interactor for create new label
This commit is contained in:
@@ -10,7 +10,6 @@ import 'package:jmap_dart_client/http/http_client.dart';
|
||||
import 'package:jmap_dart_client/jmap/account_id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/capability/capability_identifier.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/capability/core_capability.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/error/method/error_method_response.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/error/set_error.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/id.dart';
|
||||
import 'package:jmap_dart_client/jmap/core/patch_object.dart';
|
||||
@@ -197,24 +196,7 @@ class MailboxAPI with HandleSetErrorMixin, MailAPIMixin {
|
||||
parentId: request.parentId);
|
||||
return newMailboxCreated;
|
||||
} else {
|
||||
throw _parseErrorForSetMailboxResponse(setMailboxResponse, generateCreateId);
|
||||
}
|
||||
}
|
||||
|
||||
_parseErrorForSetMailboxResponse(SetMailboxResponse? response, Id requestId) {
|
||||
final mapError = response?.notCreated ?? response?.notUpdated ?? response?.notDestroyed;
|
||||
if (mapError != null && mapError.containsKey(requestId)) {
|
||||
final setError = mapError[requestId];
|
||||
log('MailboxAPI::_parseErrorForSetMailboxResponse():setError: $setError');
|
||||
if (setError?.type == ErrorMethodResponse.invalidArguments) {
|
||||
throw InvalidArgumentsMethodResponse(description: setError?.description);
|
||||
} else if (setError?.type == ErrorMethodResponse.invalidResultReference) {
|
||||
throw InvalidResultReferenceMethodResponse(description: setError?.description);
|
||||
} else {
|
||||
throw UnknownMethodResponse(description: setError?.description);
|
||||
}
|
||||
} else {
|
||||
throw UnknownMethodResponse();
|
||||
throw parseErrorForSetResponse(setMailboxResponse, generateCreateId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user