feat: expose some more info in /settings
This commit is contained in:
parent
130a1996d7
commit
c3291edd4f
3 changed files with 37 additions and 1 deletions
|
@ -2,6 +2,7 @@ package user
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"codeberg.org/u1f320/pronouns.cc/backend/db"
|
||||
"codeberg.org/u1f320/pronouns.cc/backend/log"
|
||||
|
@ -29,6 +30,8 @@ type GetUserResponse struct {
|
|||
type GetMeResponse struct {
|
||||
GetUserResponse
|
||||
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
|
||||
MaxInvites int `json:"max_invites"`
|
||||
IsAdmin bool `json:"is_admin"`
|
||||
ListPrivate bool `json:"list_private"`
|
||||
|
@ -194,6 +197,7 @@ func (s *Server) getMeUser(w http.ResponseWriter, r *http.Request) error {
|
|||
|
||||
render.JSON(w, r, GetMeResponse{
|
||||
GetUserResponse: dbUserToResponse(u, fields, members),
|
||||
CreatedAt: u.ID.Time(),
|
||||
MaxInvites: u.MaxInvites,
|
||||
IsAdmin: u.IsAdmin,
|
||||
ListPrivate: u.ListPrivate,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue