put error status
This commit is contained in:
		@@ -12,4 +12,5 @@ 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()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user