mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 14:52:13 -04:00
Review fix
This commit is contained in:
parent
2c045b8cfe
commit
ec1b6ac9f7
@ -86,7 +86,6 @@ class NoteRoomDaoTest {
|
||||
fun saveNote() = runBlocking {
|
||||
val context = ApplicationProvider.getApplicationContext<Context>()
|
||||
val notesItem: NoteListItem = mockk(relaxed = true)
|
||||
val notesItemList: List<NoteListItem> = listOf(notesItem)
|
||||
db = Room.inMemoryDatabaseBuilder(
|
||||
context, KiwixRoomDatabase::class.java
|
||||
).build()
|
||||
|
@ -49,13 +49,13 @@ abstract class NotesRoomDao : PageDao {
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
abstract fun saveNote(notesRoomEntity: NotesRoomEntity)
|
||||
|
||||
@Query("DELETE FROM NotesRoomEntity WHERE noteTitle=:noteUniqueKey")
|
||||
abstract fun deleteNote(noteUniqueKey: String)
|
||||
@Query("DELETE FROM NotesRoomEntity WHERE noteTitle=:noteTitle")
|
||||
abstract fun deleteNote(noteTitle: String)
|
||||
|
||||
fun deleteNotes(notesList: List<NoteListItem>) {
|
||||
notesList.forEachIndexed { _, note ->
|
||||
val notesRoomEntity = NotesRoomEntity(note)
|
||||
deleteNote(noteUniqueKey = notesRoomEntity.noteTitle)
|
||||
deleteNote(noteTitle = notesRoomEntity.noteTitle)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user