X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=api%2Fmarket_config.go;h=c2248b354e876403361f7a67169ae845ab7e2e90;hb=16e43cc77935a979c48e75f1ec8ed792952a4ae8;hp=25e390d627811ad7c24136f195743e282f26d766;hpb=bf5deb87cef2b6f1370c808821dfb631d00590f6;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FFront.git diff --git a/api/market_config.go b/api/market_config.go index 25e390d..c2248b3 100644 --- a/api/market_config.go +++ b/api/market_config.go @@ -45,6 +45,14 @@ func (q MarketConfigQuery) Run() (interface{}, *Error) { } + if _, ok := config.Config["key"]; !ok { + config.Config["key"] = "" + } + + if _, ok := config.Config["secret"]; !ok { + config.Config["secret"] = "" + } + return config.Config, nil } @@ -76,7 +84,7 @@ func (q MarketBalanceQuery) Run() (interface{}, *Error) { } if config.Config["key"] == "" || config.Config["secret"] == "" { - return nil, &Error{BadRequest, "your credentials for this market are not setup", fmt.Errorf("'%v' credentials are not setup", q.In.Market)} + return nil, &Error{InvalidMarketCredentials, "your credentials for this market are not setup", fmt.Errorf("'%v' credentials are not setup", q.In.Market)} } result := struct {