mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-05-06 13:40:04 -05:00
24 lines
374 B
Go
24 lines
374 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
"wwfc/qr2"
|
|
)
|
|
|
|
func HandleGroups(w http.ResponseWriter, r *http.Request) {
|
|
query, err := parseGet(r, w, RoleNone)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
groups := qr2.GetGroups(query["game"], query["id"], true)
|
|
|
|
if len(groups) == 0 {
|
|
// I would return No Content, but here is compatibility
|
|
replyOK(w, "[]")
|
|
return
|
|
}
|
|
|
|
replyOK(w, groups)
|
|
}
|