Skip to content

Commit

Permalink
fix: global search warning (#3643)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Feb 6, 2025
1 parent 49446ea commit f806429
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions app/controllers/avo/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def search_resource(resource)
return nil unless render_error?

search_query_undefined = error_payload(
_label: "Please configure the search for #{resource}",
header: "⚠️ Warning ⚠️",
help: "",
_label: "Search is disabled for #{resource}.\n To enable it please use this guide...",
_url: "https://docs.avohq.io/3.0/search.html#enable-search-for-a-resource"
)

Expand Down Expand Up @@ -207,10 +209,15 @@ def render_error(...)
}, status: 500
end

def error_payload(_label:, _url: "")
def error_payload(
_label:,
_url: "",
header: "🚨 An error occurred during search 🚨",
help: "Please review and resolve the issue before deployment 🚨"
)
{
header: "🚨 An error occurred during search 🚨",
help: "Please review and resolve the issue before deployment 🚨",
header:,
help:,
results: {
_label:,
_url:,
Expand Down

0 comments on commit f806429

Please sign in to comment.