Add link between lexiconDetail and questDetail
This commit is contained in:
parent
b17eefac39
commit
4967989315
3 changed files with 23 additions and 5 deletions
|
|
@ -1,9 +1,7 @@
|
|||
package com.pixelized.rplexicon.repository
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.core.net.toUri
|
||||
import com.google.api.client.extensions.android.http.AndroidHttp
|
||||
import com.google.api.client.json.gson.GsonFactory
|
||||
import com.google.api.services.sheets.v4.Sheets
|
||||
|
|
@ -42,6 +40,10 @@ class LexiconRepository @Inject constructor(
|
|||
private val _data = MutableStateFlow<List<Lexicon>>(emptyList())
|
||||
val data: StateFlow<List<Lexicon>> get() = _data
|
||||
|
||||
fun findId(name: String?): Int? {
|
||||
return name?.let { _data.value.firstOrNull { item -> item.name == it }?.id }
|
||||
}
|
||||
|
||||
@Throws(ServiceNotReady::class, IncompatibleSheetStructure::class, Exception::class)
|
||||
suspend fun fetchLexicon() {
|
||||
val service = sheetService
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue