More general backend work, in the middle of the night... Zzzz

This commit is contained in:
Torkel Ödegaard
2014-12-17 03:09:54 +01:00
parent c7ed348ee8
commit adf4e72cf8
6 changed files with 49 additions and 5 deletions
+8
View File
@@ -56,6 +56,14 @@ func (ctx *Context) Handle(status int, title string, err error) {
ctx.HTML(status, strconv.Itoa(status))
}
func (ctx *Context) JsonOK(message string) {
resp := make(map[string]interface{})
resp["message"] = message
ctx.JSON(200, resp)
}
func (ctx *Context) JsonApiErr(status int, message string, err error) {
resp := make(map[string]interface{})