Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
This commit is contained in:
parneet-guraya 2024-12-16 01:23:44 +05:30
parent 2daca3aa98
commit c89469e208
No known key found for this signature in database
GPG key ID: 63B807C4B2A9064B
6 changed files with 5 additions and 17 deletions

View file

@ -5,7 +5,6 @@ import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import fr.free.nrw.commons.bookmarks.models.BookmarksCategoryModal
import kotlinx.coroutines.flow.Flow
@Dao

View file

@ -1,9 +0,0 @@
package fr.free.nrw.commons.bookmarks.category
class BookmarkCategoriesViewModel(
) {
}

View file

@ -1,4 +1,4 @@
package fr.free.nrw.commons.bookmarks.models
package fr.free.nrw.commons.bookmarks.category
import androidx.room.Entity
import androidx.room.PrimaryKey
@ -6,4 +6,4 @@ import androidx.room.PrimaryKey
@Entity(tableName = "bookmarks_categories")
data class BookmarksCategoryModal(
@PrimaryKey val categoryName: String
)
)

View file

@ -205,7 +205,6 @@ class CategoryDetailsActivity : BaseActivity(),
}
R.id.menu_bookmark_current_category -> {
//TODO: most likely won't be null
categoryName?.let {
viewModel.onBookmarkClick(categoryName = it)
}

View file

@ -4,7 +4,7 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.viewModelScope
import fr.free.nrw.commons.bookmarks.category.BookmarkCategoriesDao
import fr.free.nrw.commons.bookmarks.models.BookmarksCategoryModal
import fr.free.nrw.commons.bookmarks.category.BookmarksCategoryModal
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.update
@ -43,7 +43,6 @@ class CategoryDetailsViewModel(
private fun addBookmark(categoryName: String) {
viewModelScope.launch {
// TODO [Parry] view only knows about `name` see if we can have more data
val categoryItem = BookmarksCategoryModal(
categoryName = categoryName
)
@ -74,4 +73,4 @@ class CategoryDetailsViewModel(
throw IllegalArgumentException("Unknown class name")
}
}
}
}

View file

@ -4,7 +4,7 @@ import androidx.room.Database
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import fr.free.nrw.commons.bookmarks.category.BookmarkCategoriesDao
import fr.free.nrw.commons.bookmarks.models.BookmarksCategoryModal
import fr.free.nrw.commons.bookmarks.category.BookmarksCategoryModal
import fr.free.nrw.commons.contributions.Contribution
import fr.free.nrw.commons.contributions.ContributionDao
import fr.free.nrw.commons.customselector.database.NotForUploadStatus