Compare commits
No commits in common. "192da1a74fad99e1389af30de085a9727902b71b" and "7bd73b4ddcba69e413427e24fc9f8c8a429eadfe" have entirely different histories.
192da1a74f
...
7bd73b4ddc
|
|
@ -1,7 +1,6 @@
|
|||
package routing
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"log"
|
||||
"net/http"
|
||||
"slices"
|
||||
|
|
@ -144,11 +143,6 @@ func GroupPost(app *lishwist.Session, session *response.Session, h http.Header,
|
|||
return response.Data("", group)
|
||||
}
|
||||
|
||||
type GroupList struct {
|
||||
XMLName xml.Name `xml:"Groups" json:"-"`
|
||||
Groups []lishwist.Group `xml:"Group"`
|
||||
}
|
||||
|
||||
func Groups(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response {
|
||||
admin := app.Admin()
|
||||
if admin == nil {
|
||||
|
|
@ -160,5 +154,5 @@ func Groups(app *lishwist.Session, session *response.Session, h http.Header, r *
|
|||
return response.Error(http.StatusInternalServerError, "Failed to get groups: %s", err)
|
||||
}
|
||||
|
||||
return response.Data("", GroupList{Groups: groups})
|
||||
return response.Data("", groups)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package routing
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
lishwist "lishwist/core"
|
||||
"lishwist/http/response"
|
||||
"net/http"
|
||||
|
|
@ -9,11 +8,6 @@ import (
|
|||
"github.com/Teajey/rsvp"
|
||||
)
|
||||
|
||||
type UserList struct {
|
||||
XMLName xml.Name `xml:"Users" json:"-"`
|
||||
Users []lishwist.User `xml:"User"`
|
||||
}
|
||||
|
||||
func Users(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response {
|
||||
admin := app.Admin()
|
||||
if admin == nil {
|
||||
|
|
@ -25,7 +19,7 @@ func Users(app *lishwist.Session, session *response.Session, h http.Header, r *h
|
|||
return response.Error(http.StatusInternalServerError, "Failed to get users: %s", err)
|
||||
}
|
||||
|
||||
return response.Data("", UserList{Users: users})
|
||||
return response.Data("", users)
|
||||
}
|
||||
|
||||
func User(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response {
|
||||
|
|
|
|||
Loading…
Reference in New Issue