From b0b876974fa3fe2c4713bd3ea6aec7cb8106e939 Mon Sep 17 00:00:00 2001 From: Mina Mikhail Date: Fri, 20 Aug 2021 23:49:30 +0200 Subject: [PATCH] + Code Refactoring --- .../news/data/data_source/local/ArticlesDao.kt | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/app/src/main/java/com/mina_mikhail/newsapp/features/news/data/data_source/local/ArticlesDao.kt b/app/src/main/java/com/mina_mikhail/newsapp/features/news/data/data_source/local/ArticlesDao.kt index 241dbd9..0413d1d 100644 --- a/app/src/main/java/com/mina_mikhail/newsapp/features/news/data/data_source/local/ArticlesDao.kt +++ b/app/src/main/java/com/mina_mikhail/newsapp/features/news/data/data_source/local/ArticlesDao.kt @@ -10,27 +10,13 @@ import com.mina_mikhail.newsapp.features.news.domain.entity.model.Article @Dao interface ArticlesDao { - /** - * Select all articles from the articles table. - * - * @return all articles. - */ + @Query("SELECT * FROM articles") fun getAll(): LiveData> - /** - * Insert articles in the database. If the article already exists, replace it. - * - * @param article the city to be inserted. - */ @Insert(onConflict = OnConflictStrategy.REPLACE) suspend fun insert(article: Article) - /** - * Delete article from the articles table. - * - * @param article the city to be inserted. - */ @Delete suspend fun delete(article: Article) } \ No newline at end of file