Add history description (#98)
All checks were successful
Backend Deploy / build (push) Successful in 3m1s
Backend Build and Test / build (push) Successful in 3m5s

Closes #20

Reviewed-on: #98
This commit was merged in pull request #98.
This commit is contained in:
2025-05-27 10:55:13 +02:00
parent 56a19acd0f
commit db2f518cc2
7 changed files with 51 additions and 21 deletions

View File

@@ -539,6 +539,11 @@ func postHistory(c *gin.Context) {
return
}
if historyRequest.Description == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "Description cannot be empty"})
return
}
exists, err := db.UserExists(userId)
if err != nil {
log.Printf(ErrCheckingUserExist, err)