GET /admin/api/v1/users/{userid}
(w http.ResponseWriter, r *http.Request)
| 36 | |
| 37 | // GET /admin/api/v1/users/{userid} |
| 38 | func 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} |
| 56 | func apiV1PatchUser(w http.ResponseWriter, r *http.Request) { |
nothing calls this directly
no test coverage detected