Skip to content

Commit

Permalink
chore: fix issues after gradle SDK update
Browse files Browse the repository at this point in the history
Signed-off-by: VishnuSanal <[email protected]>
  • Loading branch information
VishnuSanal committed Feb 29, 2024
1 parent 9eaf0ad commit 58449e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class MainViewModel(application: Application) : AndroidViewModel(application) {
this.repository = SaveItemRepository(application)
}

fun insert(saveItem: SaveItem?) {
fun insert(saveItem: SaveItem) {
viewModelScope.launch(Dispatchers.IO) {
repository?.insertSaveItem(saveItem)
}
}

fun delete(saveItem: SaveItem?) {
fun delete(saveItem: SaveItem) {
viewModelScope.launch(Dispatchers.IO) {
repository?.deleteSaveItem(saveItem)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ import androidx.room.Update
interface SaveItemDao {

@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insert(saveItem: SaveItem?)
fun insert(saveItem: SaveItem)

@Update
fun update(saveItem: SaveItem?)
fun update(saveItem: SaveItem)

@Delete
fun delete(saveItem: SaveItem?)
fun delete(saveItem: SaveItem)

@Query("SELECT * FROM SaveItem")
fun getAll(): LiveData<List<SaveItem?>>
fun getAll(): LiveData<List<SaveItem>>

@Query("DELETE FROM SaveItem")
fun deleteAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class SaveItemRepository(application: Application?) {
return saveItemDao.getSaveItem(id)
}

fun insertSaveItem(saveItem: SaveItem?) {
fun insertSaveItem(saveItem: SaveItem) {
saveItemDao.insert(saveItem)
}

suspend fun updateSaveItem(saveItem: SaveItem?) {
suspend fun updateSaveItem(saveItem: SaveItem) {
saveItemDao.update(saveItem)
}

fun deleteSaveItem(saveItem: SaveItem?) {
fun deleteSaveItem(saveItem: SaveItem) {
saveItemDao.delete(saveItem)
}

Expand Down

0 comments on commit 58449e2

Please sign in to comment.