mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-23 09:01:21 +00:00

* feat: try using folder2 * feat: update * feat: implement handlers * fix: compile errors * chore: add unsafe send + sync * feat: remove unsafe impl * fix: replace folder with foler2 * chore: dart compile errors * test: fix test * test: fix test * test: bypass existing tests * feat: open latest view * chore: fix dart warnings * chore: config notification * fix: folder notification bugs * fix: doesn't open the new view after creating * chore: rename struct * refactor: user id * test: fix test * chore: remove unused user_id * fix: fix read workspace views * chore: rename appflowy data folder * chore: update ref * fix: tauri build
35 lines
1016 B
Dart
35 lines
1016 B
Dart
import 'dart:async';
|
|
import 'package:dartz/dartz.dart';
|
|
import 'package:appflowy_backend/dispatch/dispatch.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
|
|
import 'package:appflowy_backend/protobuf/flowy-folder2/trash.pb.dart';
|
|
|
|
class TrashService {
|
|
Future<Either<RepeatedTrashPB, FlowyError>> readTrash() {
|
|
return FolderEventReadTrash().send();
|
|
}
|
|
|
|
Future<Either<Unit, FlowyError>> putback(String trashId) {
|
|
final id = TrashIdPB.create()..id = trashId;
|
|
|
|
return FolderEventPutbackTrash(id).send();
|
|
}
|
|
|
|
Future<Either<Unit, FlowyError>> deleteViews(List<String> trash) {
|
|
final items = trash.map((trash) {
|
|
return TrashIdPB.create()..id = trash;
|
|
});
|
|
|
|
final ids = RepeatedTrashIdPB(items: items);
|
|
return FolderEventDeleteTrash(ids).send();
|
|
}
|
|
|
|
Future<Either<Unit, FlowyError>> restoreAll() {
|
|
return FolderEventRestoreAllTrash().send();
|
|
}
|
|
|
|
Future<Either<Unit, FlowyError>> deleteAll() {
|
|
return FolderEventDeleteAllTrash().send();
|
|
}
|
|
}
|