Only add search parameter to getcontents request when search field is not empty

This commit is contained in:
Junior 2024-12-02 08:38:12 -05:00
parent eb04386d68
commit 6b58de0033

View File

@ -49,9 +49,11 @@ function redirectToLogin() {
function getContents() {
if ( searchTimeout ) clearTimeout(searchTimeout);
var data = {};
if ( $("#search").val() != "" ) data.search = $("#search").val();
$.ajax({
url : 'ajax/getcontents.php',
data : {search: $("#search").val()},
data : data,
dataType : 'json',
success : function(data, stat, jqo) {
if ( data.validated == false ) redirectToLogin();