First version of querying data from postgres

This commit is contained in:
Guntis Smaukstelis
2023-12-15 13:46:45 +02:00
parent e89b526a88
commit 3a1f0ac726
9 changed files with 85 additions and 49 deletions
+3 -5
View File
@@ -1,5 +1,6 @@
package server
import cats.data.NonEmptyList
import parse.Aggregate.AggregateKey
import java.time.{LocalDate, LocalDateTime}
@@ -50,11 +51,8 @@ object ValidateRoutes {
}
object CityList {
def unapply(str: String): Option[List[String]] = {
str.split(",").toList match {
case Nil => None
case list => Some(list)
}
def unapply(str: String): Option[NonEmptyList[String]] = {
NonEmptyList.fromList(str.split(",").toList)
}
}