gob 등록

This commit is contained in:
2023-07-17 17:47:07 +09:00
parent 67cca13326
commit ba61a11659
7 changed files with 125 additions and 39 deletions

View File

@ -2,7 +2,6 @@ package core
import (
"encoding/json"
"io"
"net/http"
common "repositories.action2quare.com/ayo/gocommon"
@ -486,14 +485,15 @@ func (sub *subTavern) UpdateGroupDocument(w http.ResponseWriter, r *http.Request
return
}
body, err := io.ReadAll(r.Body)
if err != nil {
var frag bson.M
dec := json.NewDecoder(r.Body)
if err := dec.Decode(&frag); err != nil {
logger.Error("UpdateGroupDocument failed. readBsonDoc err :", err)
w.WriteHeader(http.StatusBadRequest)
return
}
if err := group.UpdateGroupDocument(gid, body); err != nil {
if err := group.UpdateGroupDocument(gid, frag); err != nil {
logger.Error("UpdateGroupDocument failed. group.UpdateGroupDocument returns err :", err)
w.WriteHeader(http.StatusBadRequest)
return