File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
app/src/main/java/com/vladshurakov/jetnotesapp/feature_notes/data/data_source Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,17 @@ interface NoteDao {
3838 @Query(" SELECT * FROM note WHERE folder = :folder ORDER BY pinned DESC, timestamp ASC" )
3939 fun getAsc (folder : Folder ): Flow <List <NoteEntity >>
4040
41- @Query(" SELECT * FROM note WHERE (title LIKE '%' || :query || '%' OR content LIKE '%' || :query || '%') ORDER BY pinned DESC, timestamp DESC" )
41+ @Query(
42+ " SELECT * FROM note WHERE " +
43+ " (title LIKE '%' || :query || '%' OR content LIKE '%' || :query || '%') " +
44+ " AND folder = 'NOTES' ORDER BY pinned DESC, timestamp DESC"
45+ )
4246 fun getDesc (query : String ): Flow <List <NoteEntity >>
4347
44- @Query(" SELECT * FROM note WHERE (title LIKE '%' || :query || '%' OR content LIKE '%' || :query || '%') ORDER BY pinned ASC, timestamp ASC" )
48+ @Query(
49+ " SELECT * FROM note WHERE " +
50+ " (title LIKE '%' || :query || '%' OR content LIKE '%' || :query || '%') " +
51+ " AND folder = 'NOTES' ORDER BY pinned ASC, timestamp ASC"
52+ )
4553 fun getAsc (query : String ): Flow <List <NoteEntity >>
4654}
You can’t perform that action at this time.
0 commit comments