MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / apiV1GetUser

Function apiV1GetUser

internal/web/api_v1_users.go:38–53  ·  view source on GitHub ↗

GET /admin/api/v1/users/{userid}

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

36
37// GET /admin/api/v1/users/{userid}
38func apiV1GetUser(w http.ResponseWriter, r *http.Request) {
39 userId := resolveUserId(w, r.PathValue("userid"))
40 if userId == 0 {
41 return
42 }
43
44 u := loadUserRecord(w, userId)
45 if u == nil {
46 return
47 }
48
49 writeJSON(w, http.StatusOK, APIResponse[*users.UserRecord]{
50 Success: true,
51 Data: u,
52 })
53}
54
55// PATCH /admin/api/v1/users/{userid}
56func apiV1PatchUser(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls 3

resolveUserIdFunction · 0.85
loadUserRecordFunction · 0.85
writeJSONFunction · 0.85

Tested by

no test coverage detected