Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: page html template when singleProductOptions is undefined #2953

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/src/handlers/page_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,10 @@ pub async fn public_page(
..config.PUBLIC_DATASET.extra_params.unwrap_or_default()
}
})
.unwrap();
.map_err(|e| {
log::error!("Error rendering template: {:?}", e);
ServiceError::InternalServerError("Error rendering template".to_string())
})?;

Ok(HttpResponse::Ok().body(response_body))
} else {
Expand Down
7 changes: 4 additions & 3 deletions server/src/public/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@
<main>
<div class="basic">
<div id="root" class="min-h-[36px]"></div>
{% if params.singleProductOptions.productName %} {% include "product.html" %} {%
endif %} {% if tabs|length > 0 %} {% include "tabs.html" %} {% else %}
{% include "search-component-code.html" %} {% endif %}
{% if params.singleProductOptions and params.singleProductOptions.productName %} {% include
"product.html" %} {% endif %} {% if tabs|length > 0 %} {% include
"tabs.html" %} {% else %} {% include "search-component-code.html" %} {%
endif %}
</div>
</main>
{% if logged_in %}
Expand Down