현재 block된 정보를 조회

This commit is contained in:
2023-09-25 12:29:26 +09:00
parent 275b9b12e3
commit d873965d37
2 changed files with 16 additions and 2 deletions

View File

@ -161,8 +161,14 @@ func (caller apiCaller) uploadAPI(w http.ResponseWriter, r *http.Request) error
func (caller apiCaller) blockAPI(w http.ResponseWriter, r *http.Request) error {
mg := caller.mg
if r.Method == "GET" {
enc := json.NewEncoder(w)
enc.Encode(mg.bl.all())
target, ok := gocommon.ReadObjectIDFormValue(r.Form, "accid")
if ok {
json.NewEncoder(w).Encode(mg.bl.all())
} else if !target.IsZero() {
if blocked, ok := mg.bl.get(target); ok && blocked != nil {
json.NewEncoder(w).Encode(blocked)
}
}
} else if r.Method == "PUT" {
body, _ := io.ReadAll(r.Body)