I have an enum of the form:
object MatchFilterType extends Enumeration {
type MatchFilterType = Value
val gt = Value("gt")
val lt = Value("lt")
val eq = Value("eq")
}
Trying to create a form val in my controller:
case class SearchRequest(mft: MatchFilterType, queryText: String, locations: List[String])
val searchForm: Form[SearchRequest] = Form(
mapping(
"mft" -> ????????,
"queryText" -> nonEmptyText,
"locations" -> list(text)
)(SearchRequest.apply)(SearchRequest.unapply)
)
I am using play 2.6.x for this project.
How do I map my enumeration in my Form val?