From 14814435169369a0449f087421defa4eb5b5c0b3 Mon Sep 17 00:00:00 2001 From: Hein Date: Thu, 20 Nov 2025 10:02:36 +0200 Subject: [PATCH] Fixed double .Model and .Table --- pkg/restheadspec/handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/restheadspec/handler.go b/pkg/restheadspec/handler.go index 604456b..f6af2e6 100644 --- a/pkg/restheadspec/handler.go +++ b/pkg/restheadspec/handler.go @@ -869,7 +869,7 @@ func (h *Handler) handleUpdate(ctx context.Context, w common.ResponseWriter, id // Fetch the updated record to return the new values modelValue := reflect.New(reflect.TypeOf(model)).Interface() - selectQuery := tx.NewSelect().Model(modelValue).Table(tableName).Where(fmt.Sprintf("%s = ?", common.QuoteIdent(pkName)), targetID) + selectQuery := tx.NewSelect().Model(modelValue).Where(fmt.Sprintf("%s = ?", common.QuoteIdent(pkName)), targetID) if err := selectQuery.ScanModel(ctx); err != nil { return fmt.Errorf("failed to fetch updated record: %w", err) }