TF-1705 Auto create default folder if missing on server CYRUS

Signed-off-by: dab246 <tdvu@linagora.com>
(cherry picked from commit 1a5bad168cddf07662f4c682189840bc8c4bdcef)
This commit is contained in:
dab246
2023-10-31 01:30:11 +07:00
committed by Dat Vu
parent 5e69c8bd1c
commit c279730309
18 changed files with 375 additions and 36 deletions
@@ -1,7 +1,9 @@
import 'package:collection/collection.dart';
import 'package:core/core.dart';
import 'package:dartz/dartz.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/method/response/set_response.dart';
import 'package:model/error_type_handler/set_method_error_handler_mixin.dart';
mixin HandleSetErrorMixin {
@@ -53,4 +55,26 @@ mixin HandleSetErrorMixin {
unCatchErrorHandler?.call(remainedError);
}
}
List<MapEntry<Id, SetError>> handleSetResponse(List<SetResponse?> listSetResponse) {
final listSetResponseNotNull = listSetResponse.whereNotNull().toList();
if (listSetResponseNotNull.isEmpty) {
return [];
}
final List<MapEntry<Id, SetError>> remainedErrors = [];
for (var response in listSetResponseNotNull) {
handleSetErrors(
notDestroyedError: response.notDestroyed,
notUpdatedError: response.notUpdated,
notCreatedError: response.notCreated,
unCatchErrorHandler: (setErrorEntry) {
remainedErrors.add(setErrorEntry);
return false;
}
);
}
logError('HandleSetErrorMixin::handleSetResponse():remainedErrors: $remainedErrors');
return remainedErrors;
}
}