test returning created safe details
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-11 09:39:11 +11:00
parent 73c487fd3d
commit b77e47ba7e
2 changed files with 2 additions and 1 deletions

View File

@@ -92,7 +92,7 @@ func AddSafeHandler(c *gin.Context) {
return 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) { func DeleteSafeHandler(c *gin.Context) {

View File

@@ -107,6 +107,7 @@ func (s *Safe) SafeAdd() (*Safe, error) {
affected, _ := result.RowsAffected() affected, _ := result.RowsAffected()
id, _ := result.LastInsertId() id, _ := result.LastInsertId()
log.Printf("SafeAdd insert returned result id '%d' affecting %d row(s).\n", id, affected) 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) log.Printf("safe: %v\n", s)
} }
} else { } else {