From 8727d34a4e125b0042341fa6e22ba7a6be472375 Mon Sep 17 00:00:00 2001 From: Nazarii-4chain Date: Fri, 19 Jan 2024 13:58:55 +0200 Subject: [PATCH 1/2] Fixed error message --- actions/destinations/update.go | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/actions/destinations/update.go b/actions/destinations/update.go index e05a862d9..43a7b7594 100644 --- a/actions/destinations/update.go +++ b/actions/destinations/update.go @@ -32,7 +32,7 @@ func (a *Action) update(w http.ResponseWriter, req *http.Request, _ httprouter.P address := params.GetString("address") lockingScript := params.GetString("locking_script") if id == "" && address == "" && lockingScript == "" { - apirouter.ReturnResponse(w, req, http.StatusExpectationFailed, bux.ErrMissingFieldID) + apirouter.ReturnResponse(w, req, http.StatusExpectationFailed, "One of the fields is missing: id, address or lockingScript") return } metadata := params.GetJSON(actions.MetadataField) diff --git a/go.sum b/go.sum index c89750fdb..df09b386e 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,8 @@ github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE= github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM= github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ= +github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= +github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/acobaugh/osrelease v0.1.0 h1:Yb59HQDGGNhCj4suHaFQQfBps5wyoKLSSX/J/+UifRE= github.com/acobaugh/osrelease v0.1.0/go.mod h1:4bFEs0MtgHNHBrmHCt67gNisnabCRAlzdVasCEGHTWY= github.com/afex/hystrix-go v0.0.0-20180209013831-27fae8d30f1a/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= From c315f814bbfb913f3a702a5e4731935e15ccd3d5 Mon Sep 17 00:00:00 2001 From: Nazarii-4chain Date: Tue, 23 Jan 2024 11:09:24 +0200 Subject: [PATCH 2/2] Updated message --- actions/destinations/update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/destinations/update.go b/actions/destinations/update.go index 43a7b7594..fe1eb8eec 100644 --- a/actions/destinations/update.go +++ b/actions/destinations/update.go @@ -32,7 +32,7 @@ func (a *Action) update(w http.ResponseWriter, req *http.Request, _ httprouter.P address := params.GetString("address") lockingScript := params.GetString("locking_script") if id == "" && address == "" && lockingScript == "" { - apirouter.ReturnResponse(w, req, http.StatusExpectationFailed, "One of the fields is missing: id, address or lockingScript") + apirouter.ReturnResponse(w, req, http.StatusExpectationFailed, "One of the fields is required: id, address or lockingScript") return } metadata := params.GetJSON(actions.MetadataField)