Commit bb6016cf by Paktalin

Minor refactoring

parent f33592da
......@@ -18,8 +18,8 @@ class AddWordFragment : WordFragment() {
override fun saveToFirestore(wordPojo: WordItem.Pojo, vocabularyId: String) {
ConfiguredFirestore.instance
.collection(VOCABULARIES).document(vocabularyId)
.collection(WORDS).add(wordPojo)
.collection(vocabularies).document(vocabularyId)
.collection(words).add(wordPojo)
.addOnSuccessListener {
Log.i(TAG, "Successfully added a new word")
clearFields()
......
......@@ -53,8 +53,8 @@ class EditWordFragment : WordFragment() {
override fun saveToFirestore(wordPojo: WordItem.Pojo, vocabularyId: String) {
ConfiguredFirestore.instance
.collection(VOCABULARIES).document(vocabularyId)
.collection(WORDS).document(wordItem.id).set(wordPojo)
.collection(vocabularies).document(vocabularyId)
.collection(words).document(wordItem.id).set(wordPojo)
.addOnSuccessListener {
Log.i(TAG, "Successfully updated the word")
hideSubmitButton()
......@@ -71,5 +71,4 @@ class EditWordFragment : WordFragment() {
}
companion object { private val TAG = "VN/" + EditWordFragment::class.java.simpleName }
}
\ No newline at end of file
......@@ -12,8 +12,8 @@ import com.paktalin.vocabularynotebook.WordItem
import kotlinx.android.synthetic.main.fragment_new_word.*
abstract class WordFragment : Fragment() {
protected val VOCABULARIES = "vocabularies"
protected val WORDS = "words"
protected val vocabularies = "vocabularies"
protected val words = "words"
private var wordEmpty: Boolean = true
set(value) { field = value; updateButtons() }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment