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

@ -127,9 +127,25 @@ class ActionService {
await _remoteAssetRepository.trash(remoteIds);
}
Future<void> delete(List<String> remoteIds) async {
Future<void> restoreTrash(List<String> ids) async {
await _assetApiRepository.restoreTrash(ids);
await _remoteAssetRepository.restoreTrash(ids);
}
Future<void> deleteRemoteAndLocal(
List<String> remoteIds,
List<String> localIds,
) async {
await _assetApiRepository.delete(remoteIds, true);
await _remoteAssetRepository.delete(remoteIds);
if (localIds.isNotEmpty) {
final deletedIds = await _assetMediaRepository.deleteAll(localIds);
if (deletedIds.isNotEmpty) {
await _localAssetRepository.delete(deletedIds);
}
}
}
Future<void> deleteLocal(List<String> localIds) async {