def createContentSources = Action.async()

in app/com/gu/floodgate/contentsource/ContentSourceApi.scala [54:66]


  def createContentSources = Action.async(parse.json) { implicit request =>
    request.body
      .validate[List[ContentSourceWithoutId]]
      .fold(
        error => jsonError,
        contentSourcesWithoutId => {
          val id = UUID.randomUUID().toString
          val contentSourcesWithId = contentSourcesWithoutId.map(ContentSource(id, _))
          contentSourcesWithId.foreach(contentSourceService.createContentSource)
          Future.successful(Created)
        }
      )
  }