mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(mobile): trash and delete action (#19681)
* feat(mobile): trash and delete action * fix lint
This commit is contained in:
parent
b8e67d0ef9
commit
a644cabab6
8 changed files with 138 additions and 4 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue