mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 17:26:18 +01:00
21 lines
688 B
Dart
21 lines
688 B
Dart
import 'package:event_bus/event_bus.dart';
|
|
import 'package:kiwi/kiwi.dart';
|
|
import 'package:nc_photos/account.dart';
|
|
import 'package:nc_photos/entity/file.dart';
|
|
import 'package:nc_photos/event/event.dart';
|
|
import 'package:nc_photos/use_case/move.dart';
|
|
import 'package:path/path.dart' as path;
|
|
|
|
class RestoreTrashbin {
|
|
RestoreTrashbin(this.fileRepo);
|
|
|
|
Future<void> call(Account account, File file) async {
|
|
await Move(fileRepo).call(account, file,
|
|
"remote.php/dav/trashbin/${account.username}/restore/${path.basename(file.path)}");
|
|
KiwiContainer()
|
|
.resolve<EventBus>()
|
|
.fire(FileTrashbinRestoredEvent(account, file));
|
|
}
|
|
|
|
final FileRepo fileRepo;
|
|
}
|