feat: Update deleted notes query to include notes with empty body in trash
This commit is contained in:
@@ -217,13 +217,15 @@ class AppDatabase extends _$AppDatabase {
|
||||
}
|
||||
|
||||
Future<List<DbNote>> getDeletedNotes() {
|
||||
return (select(notes)..where(
|
||||
(n) =>
|
||||
n.isDeleted.equals(true) &
|
||||
n.title.isNotValue('') &
|
||||
n.body.isNotValue(''),
|
||||
))
|
||||
.get();
|
||||
// A note is considered deleted (in the trash) when `is_deleted` is true
|
||||
// and at least one of `title` or `body` is not empty. Previously the
|
||||
// query required both title AND body to be non-empty which excluded
|
||||
// notes that had an empty body (common) from appearing in the trash.
|
||||
return (select(notes)..where(
|
||||
(n) => n.isDeleted.equals(true) &
|
||||
(n.title.isNotValue('') | n.body.isNotValue('')),
|
||||
))
|
||||
.get();
|
||||
}
|
||||
|
||||
Future<List<DbCategory>> getCategoriesChangedSince(DateTime since) {
|
||||
|
||||
Reference in New Issue
Block a user