feat(mobile): trash and delete action (#19681)

* feat(mobile): trash and delete action

* fix lint
This commit is contained in:
Daimolean 2025-07-03 01:26:07 +08:00 committed by GitHub
parent b8e67d0ef9
commit a644cabab6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 138 additions and 4 deletions

View file

@ -173,6 +173,36 @@ class ActionNotifier extends Notifier<void> {
}
}
Future<ActionResult> trash(ActionSource source) async {
final ids = _getOwnedRemoteForSource(source);
try {
await _service.trash(ids);
return ActionResult(count: ids.length, success: true);
} catch (error, stack) {
_logger.severe('Failed to trash assets', error, stack);
return ActionResult(
count: ids.length,
success: false,
error: error.toString(),
);
}
}
Future<ActionResult> delete(ActionSource source) async {
final ids = _getOwnedRemoteForSource(source);
try {
await _service.delete(ids);
return ActionResult(count: ids.length, success: true);
} catch (error, stack) {
_logger.severe('Failed to delete assets', error, stack);
return ActionResult(
count: ids.length,
success: false,
error: error.toString(),
);
}
}
Future<ActionResult?> editLocation(
ActionSource source,
BuildContext context,