mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
join members endpoints to one file.
This commit is contained in:
parent
f1f26b5f25
commit
9786c8d537
@ -12,6 +12,19 @@ type MemberDataPayload struct {
|
|||||||
*types.MemberProfile
|
*types.MemberProfile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *MembersHandler) membersList(w http.ResponseWriter, r *http.Request) {
|
||||||
|
members := []MemberDataPayload{}
|
||||||
|
for _, session := range h.sessions.Members() {
|
||||||
|
profile := session.GetProfile()
|
||||||
|
members = append(members, MemberDataPayload{
|
||||||
|
ID: session.ID(),
|
||||||
|
MemberProfile: &profile,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
utils.HttpSuccess(w, members)
|
||||||
|
}
|
||||||
|
|
||||||
func (h *MembersHandler) membersCreate(w http.ResponseWriter, r *http.Request) {
|
func (h *MembersHandler) membersCreate(w http.ResponseWriter, r *http.Request) {
|
||||||
data := &MemberDataPayload{
|
data := &MemberDataPayload{
|
||||||
// default values
|
// default values
|
@ -1,20 +0,0 @@
|
|||||||
package members
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"demodesk/neko/internal/utils"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (h *MembersHandler) membersList(w http.ResponseWriter, r *http.Request) {
|
|
||||||
members := []MemberDataPayload{}
|
|
||||||
for _, session := range h.sessions.Members() {
|
|
||||||
profile := session.GetProfile()
|
|
||||||
members = append(members, MemberDataPayload{
|
|
||||||
ID: session.ID(),
|
|
||||||
MemberProfile: &profile,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
utils.HttpSuccess(w, members)
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user