Skip to content
Snippets Groups Projects
Commit ae2a895a authored by Christian Pointner's avatar Christian Pointner
Browse files

implemented grups api endpoint

parent 92e3d377
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,10 @@ import ( ...@@ -30,6 +30,10 @@ import (
func (api *API) ListGroups() http.Handler { func (api *API) ListGroups() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
sendWebResponse(w, http.StatusNotImplemented, ErrorResponse{"listing groups not yet implemented"}) groups, err := api.store.ListGroups()
if err != nil {
sendWebResponse(w, http.StatusInternalServerError, ErrorResponse{err.Error()})
}
sendWebResponse(w, http.StatusOK, GroupsListing{groups})
}) })
} }
...@@ -38,7 +38,9 @@ type APIListing struct { ...@@ -38,7 +38,9 @@ type APIListing struct {
} }
// Groups // Groups
// TODO: add me type GroupsListing struct {
Groups []string `json:"groups"`
}
// Imports // Imports
// TODO: add me // TODO: add me
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment