Fixed the double table on update

This commit is contained in:
Hein
2025-12-18 12:14:39 +02:00
parent 7c861c708e
commit fb9cdc1ca0

View File

@@ -1247,7 +1247,7 @@ func (h *Handler) handleUpdate(ctx context.Context, w common.ResponseWriter, id
}
// Create update query using Model() to preserve custom types and driver.Valuer interfaces
query := tx.NewUpdate().Model(modelInstance).Table(tableName)
query := tx.NewUpdate().Model(modelInstance)
query = query.Where(fmt.Sprintf("%s = ?", common.QuoteIdent(pkName)), targetID)
// Execute BeforeScan hooks - pass query chain so hooks can modify it