화이트리스트 멤버에 tag 추가

This commit is contained in:
2023-06-19 14:31:34 +09:00
parent 40a5b4e878
commit 91790330d2
2 changed files with 28 additions and 45 deletions

View File

@ -326,7 +326,13 @@ func (caller apiCaller) whitelistAPI(w http.ResponseWriter, r *http.Request) err
}
if len(all) > 0 {
allraw, _ := json.Marshal(all)
var notexp []primitive.M
for _, v := range all {
if _, exp := v["_ts"]; !exp {
notexp = append(notexp, v)
}
}
allraw, _ := json.Marshal(notexp)
w.Write(allraw)
}
} else {
@ -345,6 +351,8 @@ func (caller apiCaller) whitelistAPI(w http.ResponseWriter, r *http.Request) err
}
member.Expired = 0
// 테스트
member.Tag = whitelistMemberTag_QA
_, _, err := mg.mongoClient.Update(CollectionWhitelist, bson.M{
"_id": primitive.NewObjectID(),