mirror of
https://github.com/immich-app/immich.git
synced 2026-05-18 03:10:24 +03:00
feat(mobile): trash/restore all (#28116)
* feat(mobile): trash/restore all * chore: remove themeData variable * chore: filter query by user * refactor --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -164,6 +164,16 @@ class RemoteAssetRepository extends DriftDatabaseRepository {
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> emptyTrash(String ownerId) async {
|
||||
await _db.remoteAssetEntity.deleteWhere((t) => t.deletedAt.isNotNull() & t.ownerId.equals(ownerId));
|
||||
}
|
||||
|
||||
Future<void> restoreAllTrash(String ownerId) async {
|
||||
await (_db.remoteAssetEntity.update()..where((t) => t.deletedAt.isNotNull() & t.ownerId.equals(ownerId))).write(
|
||||
const RemoteAssetEntityCompanion(deletedAt: Value(null)),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> delete(List<String> ids) {
|
||||
return _db.batch((batch) {
|
||||
for (final id in ids) {
|
||||
|
||||
Reference in New Issue
Block a user