Add another useful endpoint
This commit is contained in:
parent
7e0a834e97
commit
cfd72743f3
|
@ -49,4 +49,15 @@ func GetPlayer(c *fiber.Ctx) error {
|
|||
"displayName": person.DisplayName,
|
||||
"discord": person.Discord,
|
||||
})
|
||||
}
|
||||
|
||||
func GetCachedPlayers(c *fiber.Ctx) error {
|
||||
persons := p.AllFromCache()
|
||||
players := make([]p.PersonSnapshot, len(persons))
|
||||
|
||||
for i, person := range persons {
|
||||
players[i] = *person.Snapshot()
|
||||
}
|
||||
|
||||
return c.JSON(players)
|
||||
}
|
Loading…
Reference in New Issue
Block a user