mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-22 10:44:25 +08:00
don't add exchange rate item to result if rate is invalid
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/mayswind/lab/pkg/errs"
|
||||
"github.com/mayswind/lab/pkg/log"
|
||||
"github.com/mayswind/lab/pkg/models"
|
||||
"github.com/mayswind/lab/pkg/utils"
|
||||
"github.com/mayswind/lab/pkg/validators"
|
||||
)
|
||||
|
||||
@@ -87,6 +88,10 @@ func (e *ReserveBankOfAustraliaData) ToLatestExchangeRateResponse(c *core.Contex
|
||||
continue
|
||||
}
|
||||
|
||||
if _, err := utils.StringToFloat64(item.Statistics.ExchangeRate.Observation.Value); err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
exchangeRates = append(exchangeRates, item.Statistics.ExchangeRate.ToLatestExchangeRate())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user