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() {
|
Future<List<DbNote>> getDeletedNotes() {
|
||||||
return (select(notes)..where(
|
// A note is considered deleted (in the trash) when `is_deleted` is true
|
||||||
(n) =>
|
// and at least one of `title` or `body` is not empty. Previously the
|
||||||
n.isDeleted.equals(true) &
|
// query required both title AND body to be non-empty which excluded
|
||||||
n.title.isNotValue('') &
|
// notes that had an empty body (common) from appearing in the trash.
|
||||||
n.body.isNotValue(''),
|
return (select(notes)..where(
|
||||||
))
|
(n) => n.isDeleted.equals(true) &
|
||||||
.get();
|
(n.title.isNotValue('') | n.body.isNotValue('')),
|
||||||
|
))
|
||||||
|
.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<DbCategory>> getCategoriesChangedSince(DateTime since) {
|
Future<List<DbCategory>> getCategoriesChangedSince(DateTime since) {
|
||||||
|
|||||||
Reference in New Issue
Block a user