This commit is contained in:
Dan Sosedoff 2014-10-10 00:28:33 -05:00
parent 29f7e2d58c
commit 7adf74ffd4

View File

@ -45,7 +45,7 @@ var options struct {
Static string `short:"s" description:"Path to static assets" default:"./static"` Static string `short:"s" description:"Path to static assets" default:"./static"`
} }
func formatResult(res *Result) []map[string]interface{} { func (res *Result) Format() []map[string]interface{} {
var items []map[string]interface{} var items []map[string]interface{}
for _, row := range res.Rows { for _, row := range res.Rows {
@ -176,7 +176,7 @@ func API_GetTable(c *gin.Context) {
return return
} }
c.JSON(200, formatResult(res)) c.JSON(200, res.Format())
} }
func API_History(c *gin.Context) { func API_History(c *gin.Context) {
@ -191,7 +191,7 @@ func API_Info(c *gin.Context) {
return return
} }
c.JSON(200, formatResult(res)[0]) c.JSON(200, res.Format()[0])
} }
func API_HandleQuery(query string, c *gin.Context) { func API_HandleQuery(query string, c *gin.Context) {