Drop items on tags in edit favorites sheet to tag them

This commit is contained in:
MM20
2022-09-24 23:01:32 +02:00
parent 2c307693f2
commit 60990e767c
5 changed files with 99 additions and 8 deletions
@@ -32,6 +32,7 @@ interface CustomAttributesRepository {
suspend fun getAllTags(startsWith: String? = null): List<String>
fun getItemsForTag(tag: String): Flow<List<Searchable>>
fun addTag(item: Searchable, tag: String)
}
internal class CustomAttributesRepositoryImpl(
@@ -122,6 +123,13 @@ internal class CustomAttributesRepositoryImpl(
}
}
override fun addTag(item: Searchable, tag: String) {
val dao = appDatabase.customAttrsDao()
scope.launch {
dao.addTag(item.key, tag)
}
}
override suspend fun search(query: String): Flow<List<Searchable>> {
if (query.isBlank()) {
return flow {