]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git/blobdiff - api/market_config.go
Account page.
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Front.git] / api / market_config.go
index 25e390d627811ad7c24136f195743e282f26d766..c2248b354e876403361f7a67169ae845ab7e2e90 100644 (file)
@@ -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 {