2015-01-15 05:16:54 -06:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/torkelo/grafana-pro/pkg/bus"
|
|
|
|
"github.com/torkelo/grafana-pro/pkg/middleware"
|
|
|
|
m "github.com/torkelo/grafana-pro/pkg/models"
|
|
|
|
)
|
|
|
|
|
2015-01-19 11:01:04 -06:00
|
|
|
func AdminSearchUsers(c *middleware.Context) {
|
2015-01-15 05:16:54 -06:00
|
|
|
// query := c.QueryStrings("q")
|
|
|
|
// page := c.QueryStrings("p")
|
|
|
|
|
2015-01-19 11:01:04 -06:00
|
|
|
query := m.SearchUsersQuery{Query: "", Page: 0, Limit: 20}
|
2015-01-15 05:16:54 -06:00
|
|
|
if err := bus.Dispatch(&query); err != nil {
|
|
|
|
c.JsonApiErr(500, "Failed to fetch collaboratos", err)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
c.JSON(200, query.Result)
|
|
|
|
}
|