mirror of
https://github.com/immich-app/immich.git
synced 2025-01-06 03:46:47 +01:00
e0fa3cdbc7
* ExifInfoRepository * ActivityApiRepository * initial AssetApiRepository
25 lines
847 B
Dart
25 lines
847 B
Dart
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
|
import 'package:immich_mobile/entities/asset.entity.dart';
|
|
import 'package:immich_mobile/interfaces/asset_api.interface.dart';
|
|
import 'package:immich_mobile/providers/api.provider.dart';
|
|
import 'package:immich_mobile/repositories/base_api.repository.dart';
|
|
import 'package:openapi/api.dart';
|
|
|
|
final assetApiRepositoryProvider = Provider(
|
|
(ref) => AssetApiRepository(ref.watch(apiServiceProvider).assetsApi),
|
|
);
|
|
|
|
class AssetApiRepository extends BaseApiRepository
|
|
implements IAssetApiRepository {
|
|
final AssetsApi _api;
|
|
|
|
AssetApiRepository(this._api);
|
|
|
|
@override
|
|
Future<Asset> update(String id, {String? description}) async {
|
|
final response = await checkNull(
|
|
_api.updateAsset(id, UpdateAssetDto(description: description)),
|
|
);
|
|
return Asset.remote(response);
|
|
}
|
|
}
|