func GetAgents(ctx *Context, query model.GetAgentsQuery) { query.OrgId = ctx.OrgId agents, err := sqlstore.GetAgents(&query) if err != nil { log.Error(3, err.Error()) ctx.JSON(200, rbody.ErrResp(500, err)) return } ctx.JSON(200, rbody.OkResp("agents", agents)) }