my friend was saying I might want to use an enum, ...
# android
k
my friend was saying I might want to use an enum, but I am not totally sure how they work. I came up with this, which connects the JSON error
fieldName
strings to the enum `ErrorField`s which would correspond to an input field in my app
Copy code
enum class ErrorFields(val fieldName: String) {
        PHONENUMBER("number"),
        VERIFICATIONCODE("code"),
        FIRSTNAME("first_name"),
        LASTNAME("last_name"),
        IMAGE("image"),
        GENERIC("generic"),
    }