From e2bec481f0c340f959a5875a4383651f2503e703 Mon Sep 17 00:00:00 2001 From: mklee Date: Wed, 6 Sep 2023 17:11:47 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EB=AF=BC=EC=9A=B0]=20=EC=BA=90?= =?UTF-8?q?=EB=A6=AD=ED=84=B0=20=EC=83=9D=EC=84=B1=20=EC=A0=9C=ED=95=9C=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(=EB=8C=80=EC=8B=A0=20=EC=BB=A4=EB=B0=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/api.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/api.go b/core/api.go index c5fcfdc..536b380 100644 --- a/core/api.go +++ b/core/api.go @@ -405,19 +405,23 @@ func (caller apiCaller) lockcreatecharAPI(w http.ResponseWriter, r *http.Request curregion, _ := gocommon.ReadStringFormValue(r.Form, "region") + var locked map[string]any for _, regioninfo := range mg { region := regioninfo["divisions"].(primitive.M) for idx, rl := range region { if idx == curregion { if rl.(primitive.M)["lockcreatechar"].(bool) { - w.Write([]byte(fmt.Sprintf(`{"create":"%t"}`, true))) + locked["lock"] = true } else { - w.Write([]byte(fmt.Sprintf(`{"create":"%t"}`, false))) + locked["lock"] = false } } } } + create, _ := json.Marshal(locked) + w.Write(create) + return nil }