From 90d8247c0fb97778eed3305562747446e51dfe07 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Sun, 28 Apr 2024 22:49:04 +0200 Subject: [PATCH] Fix null problems --- pkg/customer/admin.go | 8 ++++---- web/templates/admin/booking/form.gohtml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/customer/admin.go b/pkg/customer/admin.go index a74ef06..9dfc218 100644 --- a/pkg/customer/admin.go +++ b/pkg/customer/admin.go @@ -275,11 +275,11 @@ func (f *ContactForm) FillFromBooking(ctx context.Context, conn *database.Conn, , holder_name , array[]::text[] , '' - , address - , city + , coalesce(address, '') + , coalesce(city, '') , '' - , postal_code - , array[country_code::text] + , coalesce(postal_code, '') + , array[coalesce(country_code::text, '')] , coalesce(email::text, '') , coalesce(phone::text, '') from booking diff --git a/web/templates/admin/booking/form.gohtml b/web/templates/admin/booking/form.gohtml index 00827c6..e99b146 100644 --- a/web/templates/admin/booking/form.gohtml +++ b/web/templates/admin/booking/form.gohtml @@ -34,7 +34,7 @@ data-hx-include="this" data-hx-target="#booking-form-fields" data-hx-replace-url="true" - {{- if .URL }} data-hx-put="{{ .URL }}" + {{- if .ID }} data-hx-put="{{ .URL }}" {{- else }} action="/admin/bookings" method="post" {{- end -}} >