]> 91.132.146.200 Git - scientia.git/commitdiff
added config change to validation
authorBanana <mail@bananas-playground.net>
Thu, 25 Jul 2024 20:11:20 +0000 (22:11 +0200)
committerBanana <mail@bananas-playground.net>
Thu, 25 Jul 2024 20:11:20 +0000 (22:11 +0200)
config change in add call

Signed-off-by: Banana <mail@bananas-playground.net>
client/go-cli/scientia/cmd/add.go
client/go-cli/scientia/cmd/root.go

index 139cee3b77b1cb5280394ae10e988d434e59f009..4529a8e0f88fcb19cf347c883498ce968d163273 100644 (file)
@@ -97,7 +97,7 @@ func upload(payload string) Response {
        jsonData, err := json.Marshal(payloadStruct)
        Helper.ErrorCheck(err, "Can not create json payload")
 
-       req, err := http.NewRequest(http.MethodPost, ScientiaConfig.Endpoint.Url, bytes.NewBuffer(jsonData))
+       req, err := http.NewRequest(http.MethodPost, ScientiaConfig.Endpoint.Add, bytes.NewBuffer(jsonData))
        Helper.ErrorCheck(err, "Can not create http request")
        // We need to set the content type from the writer, it includes necessary boundary as well
        req.Header.Set("Content-Type", "application/json; charset=UTF-8")
index 37d3bcbaef2f63907d1fd03d03ebdbe05b26336f..93b37ab521f6262684e6de4005caed331b0e5cc2 100644 (file)
@@ -83,8 +83,8 @@ func loadConfig() {
        err = decoder.Decode(&ScientiaConfig)
        Helper.ErrorCheck(err, "Can not decode config file")
 
-       if ScientiaConfig.Endpoint.Add == "" || ScientiaConfig.Endpoint.Secret == "" {
-               log.Fatal("Empty config?")
+       if ScientiaConfig.Endpoint.Add == "" || ScientiaConfig.Endpoint.Get == "" || ScientiaConfig.Endpoint.Secret == "" {
+               log.Fatal("Empty or outdated config?")
        }
 
        if FlagDebug {