def updateCanonicalPath()

in path-manager/app/controllers/PathManagerController.scala [74:90]


  def updateCanonicalPath(id: Long, shouldFormAlias: Option[Boolean]) = Action { request =>
    val submission = request.body.asFormUrlEncoded.get
    val newPath = submission("path").head

    val update = if (shouldFormAlias.contains(true)) {PathStore.updateCanonicalWithAlias _} else {PathStore.updateCanonical _}

    update(newPath,id) match {
      case Left(error) => {
        PathOperationErrors.increment
        BadRequest(error)
      }
      case Right(result) => {
        PathUpdates.increment
        Ok(Json.toJson(result))
      }
    }
  }