Endpoint getCurrentFxRate tweaked

This commit is contained in:
constantine2nd 2018-02-09 14:12:46 +01:00
parent 50a9943744
commit 509c1bcf74

View File

@ -257,7 +257,7 @@ trait APIMethods220 {
_ <- tryo(assert(isValidCurrencyISOCode(fromCurrencyCode))) ?~! ErrorMessages.InvalidISOCurrencyCode
_ <- tryo(assert(isValidCurrencyISOCode(toCurrencyCode))) ?~! ErrorMessages.InvalidISOCurrencyCode
_ <- cc.user ?~! UserNotLoggedIn
fxRate <- tryo(Connector.connector.vend.getCurrentFxRate(bankId, fromCurrencyCode, toCurrencyCode).openOrThrowException(attemptedToOpenAnEmptyBox)) ?~! ErrorMessages.FXCurrencyCodeCombinationsNotSupported
fxRate <- Connector.connector.vend.getCurrentFxRate(bankId, fromCurrencyCode, toCurrencyCode) ?~! ErrorMessages.FXCurrencyCodeCombinationsNotSupported
} yield {
val viewJSON = JSONFactory220.createFXRateJSON(fxRate)
successJsonResponse(Extraction.decompose(viewJSON))