diff --git a/README.md b/README.md index 63af9b9..43cd1e9 100644 --- a/README.md +++ b/README.md @@ -12,4 +12,5 @@ Running in debug mode Testing ------- - http://localhost:8080/swagger \ No newline at end of file + http://localhost:8080/swagger + \ No newline at end of file diff --git a/controllers/table.go b/controllers/table.go index cc1f9ac..5d1887b 100644 --- a/controllers/table.go +++ b/controllers/table.go @@ -55,9 +55,11 @@ func (t *TableController) Put() { uid, err := db.Table(table).UpdateOrInsert(data) if err != nil { 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.Ctx.Output.SetStatus(http.StatusOK) t.ServeJSON() } diff --git a/sqldb-ws b/sqldb-ws new file mode 100755 index 0000000..c757886 Binary files /dev/null and b/sqldb-ws differ