use pointer to account list
This commit is contained in:
parent
5faa62f412
commit
21175bda62
1 changed files with 4 additions and 4 deletions
|
|
@ -88,11 +88,11 @@ func newAccountResponse(a *pwdless.Account) *accountResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
type accountListResponse struct {
|
type accountListResponse struct {
|
||||||
Accounts []pwdless.Account `json:"accounts"`
|
Accounts *[]pwdless.Account `json:"accounts"`
|
||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func newAccountListResponse(a []pwdless.Account, count int) *accountListResponse {
|
func newAccountListResponse(a *[]pwdless.Account, count int) *accountListResponse {
|
||||||
resp := &accountListResponse{
|
resp := &accountListResponse{
|
||||||
Accounts: a,
|
Accounts: a,
|
||||||
Count: count,
|
Count: count,
|
||||||
|
|
@ -111,7 +111,7 @@ func (rs *AccountResource) list(w http.ResponseWriter, r *http.Request) {
|
||||||
render.Render(w, r, ErrRender(err))
|
render.Render(w, r, ErrRender(err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
render.Respond(w, r, newAccountListResponse(al, count))
|
render.Respond(w, r, newAccountListResponse(&al, count))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rs *AccountResource) create(w http.ResponseWriter, r *http.Request) {
|
func (rs *AccountResource) create(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue