Skip to content

Commit

Permalink
bugfix: page html template when singleProductOptions is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
skeptrunedev authored and fedhacks committed Dec 16, 2024
1 parent 1becbfc commit c44be5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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

0 comments on commit c44be5e

Please sign in to comment.