mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
MemberData split ID and profile, return on create.
This commit is contained in:
parent
4d2fb157f9
commit
fad3ab0062
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
type MemberDataPayload struct {
|
type MemberDataPayload struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
*types.MemberProfile
|
Profile types.MemberProfile `json:"profile"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type MemberCreatePayload struct {
|
type MemberCreatePayload struct {
|
||||||
@ -44,10 +44,9 @@ func (h *MembersHandler) membersList(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
members := []MemberDataPayload{}
|
members := []MemberDataPayload{}
|
||||||
for id, profile := range entries {
|
for id, profile := range entries {
|
||||||
profile := profile
|
|
||||||
members = append(members, MemberDataPayload{
|
members = append(members, MemberDataPayload{
|
||||||
ID: id,
|
ID: id,
|
||||||
MemberProfile: &profile,
|
Profile: profile,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,6 +88,7 @@ func (h *MembersHandler) membersCreate(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
utils.HttpSuccess(w, MemberDataPayload{
|
utils.HttpSuccess(w, MemberDataPayload{
|
||||||
ID: id,
|
ID: id,
|
||||||
|
Profile: data.Profile,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user