Skip to content

Commit

Permalink
fix: Prevent ajax call if handle is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
pnu-s committed Jan 15, 2024
1 parent f651ff6 commit 916ab14
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions exodus/web/templates/snippets/reports_search_tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,16 @@
})
}
const get_results = function (query, limit) {
jQuery.ajax({
type: 'POST',
url: "/api/search",
data: '{"type": "application", "query":"' + query + '", "limit":' + limit + '}',
success: display_results,
contentType: "application/json",
dataType: 'json'
})
if (query) {
jQuery.ajax({
type: 'POST',
url: "/api/search",
data: '{"type": "application", "query":"' + query + '", "limit":' + limit + '}',
success: display_results,
contentType: "application/json",
dataType: 'json'
})
}
}
jQuery("#go").on("click", function () {
const query = jQuery.trim(jQuery("#query").val())
Expand Down

0 comments on commit 916ab14

Please sign in to comment.