From a97ac534cfcbabae04a12d937bf375abc06d2b65 Mon Sep 17 00:00:00 2001 From: "oribe(oribe1115)" Date: Mon, 26 Jul 2021 18:23:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix(backend):=20postIsu=E3=81=A7=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=83=B3=E3=82=B6=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E3=81=A1=E3=82=83=E3=82=93=E3=81=A8=E5=8F=97=E3=81=91?= =?UTF-8?q?=E6=B8=A1=E3=81=99=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/go/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapp/go/main.go b/webapp/go/main.go index 6def43ec9..ef8b80fc6 100644 --- a/webapp/go/main.go +++ b/webapp/go/main.go @@ -279,9 +279,9 @@ func getUserIDFromSession(r *http.Request) (string, error) { return userID.(string), nil } -func getJIAServiceURL() string { +func getJIAServiceURL(tx *sqlx.Tx) string { config := Config{} - err := db.Get(&config, "SELECT * FROM `isu_association_config` WHERE `name` = ?", "jia_service_url") + err := tx.Get(&config, "SELECT * FROM `isu_association_config` WHERE `name` = ?", "jia_service_url") if err != nil { if !errors.Is(err, sql.ErrNoRows) { log.Print(err) @@ -526,7 +526,7 @@ func postIsu(c echo.Context) error { } // JIAにisuのactivateをリクエスト - targetURL := getJIAServiceURL() + "/api/activate" + targetURL := getJIAServiceURL(tx) + "/api/activate" body := JIAServiceRequest{isuConditionPublicAddress, isuConditionPublicPort, jiaIsuUUID} bodyJSON, err := json.Marshal(body) if err != nil { @@ -719,7 +719,7 @@ func deleteIsu(c echo.Context) error { } // JIAにisuのdeactivateをリクエスト - targetURL := getJIAServiceURL() + "/api/deactivate" + targetURL := getJIAServiceURL(nil) + "/api/deactivate" body := JIAServiceRequest{isuConditionPublicAddress, isuConditionPublicPort, jiaIsuUUID} bodyJSON, err := json.Marshal(body) if err != nil { From ebc772dc3d680fa3f109b01a3e42ce582450ef3f Mon Sep 17 00:00:00 2001 From: "oribe(oribe1115)" Date: Mon, 26 Jul 2021 18:25:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix(backend):=20deleteIsu=E3=81=A7=E3=83=88?= =?UTF-8?q?=E3=83=A9=E3=83=B3=E3=82=B6=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E5=8F=97=E3=81=91=E6=B8=A1=E3=81=99=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webapp/go/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/go/main.go b/webapp/go/main.go index ef8b80fc6..c3665c73c 100644 --- a/webapp/go/main.go +++ b/webapp/go/main.go @@ -719,7 +719,7 @@ func deleteIsu(c echo.Context) error { } // JIAにisuのdeactivateをリクエスト - targetURL := getJIAServiceURL(nil) + "/api/deactivate" + targetURL := getJIAServiceURL(tx) + "/api/deactivate" body := JIAServiceRequest{isuConditionPublicAddress, isuConditionPublicPort, jiaIsuUUID} bodyJSON, err := json.Marshal(body) if err != nil {