added GameSystemID to Char

I am curious if this is enough
This commit is contained in:
2026-01-28 23:00:20 +01:00
parent 0424f2da00
commit c2de8a5d7d
3 changed files with 118 additions and 28 deletions
+4
View File
@@ -103,6 +103,8 @@ func UpdateCharacter(c *gin.Context) {
// Store the original ID to preserve it
originalID := character.ID
originalGameSystem := character.GameSystem
originalGameSystemId := character.GameSystemId
// Bind the updated data
if err := c.ShouldBindJSON(&character); err != nil {
@@ -112,6 +114,8 @@ func UpdateCharacter(c *gin.Context) {
// Restore the ID
character.ID = originalID
character.GameSystem = originalGameSystem
character.GameSystemId = originalGameSystemId
// Update all associations
if err := database.DB.Session(&gorm.Session{FullSaveAssociations: true}).Save(&character).Error; err != nil {