diff --git a/pkg/campsite/types/public.go b/pkg/campsite/types/public.go index caa266b..01939ba 100644 --- a/pkg/campsite/types/public.go +++ b/pkg/campsite/types/public.go @@ -34,6 +34,7 @@ func (h *PublicHandler) Handler(user *auth.User, company *auth.Company, conn *da page, err := newPublicPage(r.Context(), conn, head) if database.ErrorIsNotFound(err) { http.NotFound(w, r) + return } else if err != nil { panic(err) } @@ -54,7 +55,7 @@ func newPublicPage(ctx context.Context, conn *database.Conn, slug string) (*publ page := &publicPage{ PublicPage: template.NewPublicPage(), } - row := conn.QueryRow(ctx, "select name, description::text from campsite_type where slug = $1", slug) + row := conn.QueryRow(ctx, "select name, description::text from campsite_type where slug = $1 and active", slug) if err := row.Scan(&page.Name, &page.Description); err != nil { return nil, err }