Tweaked a function name

This commit is contained in:
constantine2nd 2018-02-02 09:57:21 +01:00
parent 509c0c5f23
commit e6ea0077e9
2 changed files with 4 additions and 4 deletions

View File

@ -645,7 +645,7 @@ object APIUtil extends MdcLoggable {
JsonResponse(jsonAst, getHeaders() ::: headers.list, Nil, httpCode)
}
def successJsonResponseFromCaseClass(cc: Any, callContext: Option[CallContext], httpCode : Int = 200)(implicit headers: CustomResponseHeaders = CustomResponseHeaders(Nil)) : JsonResponse = {
def successJsonResponseNewStyle(cc: Any, callContext: Option[CallContext], httpCode : Int = 200)(implicit headers: CustomResponseHeaders = CustomResponseHeaders(Nil)) : JsonResponse = {
val jsonAst = ApiSession.processJson(snakify(Extraction.decompose(cc)), callContext)
logAPICall(callContext.map(_.copy(endTime = Some(Helpers.now))))
callContext match {
@ -1830,7 +1830,7 @@ Versions are groups of endpoints in a file
*/
def futureToResponse[T](in: LAFuture[(T, Option[CallContext])]): JsonResponse = {
RestContinuation.async(reply => {
in.onSuccess(t => reply.apply(successJsonResponseFromCaseClass(cc = t._1, t._2)(getGatewayLoginHeader(t._2))))
in.onSuccess(t => reply.apply(successJsonResponseNewStyle(cc = t._1, t._2)(getGatewayLoginHeader(t._2))))
in.onFail {
case Failure(msg, _, _) => reply.apply(errorJsonResponse(msg))
case _ => reply.apply(errorJsonResponse("Error"))
@ -1859,7 +1859,7 @@ Versions are groups of endpoints in a file
*/
def futureToBoxedResponse[T](in: LAFuture[(T, Option[CallContext])]): Box[JsonResponse] = {
RestContinuation.async(reply => {
in.onSuccess(t => Full(reply.apply(successJsonResponseFromCaseClass(t._1, t._2)(getGatewayLoginHeader(t._2)))))
in.onSuccess(t => Full(reply.apply(successJsonResponseNewStyle(t._1, t._2)(getGatewayLoginHeader(t._2)))))
in.onFail {
case Failure(msg, _, _) => Full(reply.apply(errorJsonResponse(msg)))
case _ => Full(reply.apply(errorJsonResponse("Error")))

View File

@ -716,7 +716,7 @@ trait APIMethods300 {
ai: InboundAdapterInfoInternal <- Connector.connector.vend.getAdapterInfo() ?~ "Not implemented"
}
yield {
successJsonResponseFromCaseClass(createAdapterInfoJson(ai), None)
successJsonResponseNewStyle(createAdapterInfoJson(ai), None)
}
}
}