put error status
This commit is contained in:
parent
f1310a3a54
commit
3010940db6
@ -13,3 +13,4 @@ Running in debug mode
|
|||||||
Testing
|
Testing
|
||||||
-------
|
-------
|
||||||
http://localhost:8080/swagger
|
http://localhost:8080/swagger
|
||||||
|
|
@ -55,9 +55,11 @@ func (t *TableController) Put() {
|
|||||||
uid, err := db.Table(table).UpdateOrInsert(data)
|
uid, err := db.Table(table).UpdateOrInsert(data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Msg(err.Error())
|
log.Error().Msg(err.Error())
|
||||||
|
t.Ctx.Output.SetStatus(http.StatusBadRequest)
|
||||||
|
} else {
|
||||||
|
t.Ctx.Output.SetStatus(http.StatusOK)
|
||||||
}
|
}
|
||||||
t.Data["json"] = map[string]int{"uid": uid}
|
t.Data["json"] = map[string]int{"uid": uid}
|
||||||
t.Ctx.Output.SetStatus(http.StatusOK)
|
|
||||||
t.ServeJSON()
|
t.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user