test returning created safe details
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -92,7 +92,7 @@ func AddSafeHandler(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"message": "safe creation success"})
|
||||
c.JSON(http.StatusOK, gin.H{"message": "safe creation success", "data": s})
|
||||
}
|
||||
|
||||
func DeleteSafeHandler(c *gin.Context) {
|
||||
|
@@ -107,6 +107,7 @@ func (s *Safe) SafeAdd() (*Safe, error) {
|
||||
affected, _ := result.RowsAffected()
|
||||
id, _ := result.LastInsertId()
|
||||
log.Printf("SafeAdd insert returned result id '%d' affecting %d row(s).\n", id, affected)
|
||||
s.SafeId = int(id)
|
||||
log.Printf("safe: %v\n", s)
|
||||
}
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user