docs(arch): add documentation

This commit is contained in:
2023-04-13 23:29:27 +02:00
parent 7a3de79e36
commit e5e0550017
19 changed files with 90 additions and 30 deletions
@@ -36,7 +36,7 @@ class PhotoRepositoryImpl extends PhotoRepository {
@override
FutureOrResult<void> addPhotoToFavorites(Photo photo) => Result.tryCatchAsync(
() => _favoriteLocalDataSource.addPhotoToFavorites(photo),
(error) => ClientException('Cannot add photo to favorites.'),
(error) => const ClientException('Cannot add photo to favorites.'),
);
@override
@@ -63,14 +63,14 @@ class PhotoRepositoryImpl extends PhotoRepository {
FutureOrResult<List<Album>> getAllAlbums({int? start, int? limit}) =>
Result.tryCatchAsync(
() => _albumRemoteDataSource.getAllAlbums(start: start, limit: limit),
(error) => ServerException('Cannot retrieve all albums.'),
(error) => const ServerException('Cannot retrieve all albums.'),
);
@override
FutureOrResult<List<Photo>> getAllPhotos({int? start, int? limit}) async =>
Result.tryCatchAsync(
() => _photoRemoteDataSource.getAllPhotos(start: start, limit: limit),
(error) => ServerException('Cannot retrieve all photos.'),
(error) => const ServerException('Cannot retrieve all photos.'),
);
@override
@@ -88,7 +88,7 @@ class PhotoRepositoryImpl extends PhotoRepository {
}
return Ok(response);
} catch (_) {
return Err(
return const Err(
ClientException('Cannot retrieve all photos from favorites.'),
);
}