feat: delete actions (#20034)

* chore: show delete local

* pr feedback

* restore and perm delete action
This commit is contained in:
Alex 2025-07-22 11:36:00 -05:00 committed by GitHub
parent 2efca67217
commit aa344a3989
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 285 additions and 18 deletions

View file

@ -13,6 +13,7 @@ final assetApiRepositoryProvider = Provider(
ref.watch(apiServiceProvider).assetsApi,
ref.watch(apiServiceProvider).searchApi,
ref.watch(apiServiceProvider).stacksApi,
ref.watch(apiServiceProvider).trashApi,
),
);
@ -20,8 +21,14 @@ class AssetApiRepository extends ApiRepository {
final AssetsApi _api;
final SearchApi _searchApi;
final StacksApi _stacksApi;
final TrashApi _trashApi;
AssetApiRepository(this._api, this._searchApi, this._stacksApi);
AssetApiRepository(
this._api,
this._searchApi,
this._stacksApi,
this._trashApi,
);
Future<Asset> update(String id, {String? description}) async {
final response = await checkNull(
@ -56,6 +63,10 @@ class AssetApiRepository extends ApiRepository {
return _api.deleteAssets(AssetBulkDeleteDto(ids: ids, force: force));
}
Future<void> restoreTrash(List<String> ids) async {
await _trashApi.restoreAssets(BulkIdsDto(ids: ids));
}
Future<void> updateVisibility(
List<String> ids,
AssetVisibilityEnum visibility,