From 9f1b09bfec8a06c6ed41204d6ad036f10bda6103 Mon Sep 17 00:00:00 2001 From: Ross Keatinge Date: Sat, 13 Jul 2019 22:18:55 -0400 Subject: [PATCH] Return request object. --- Resources/public/js/select2entity.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/public/js/select2entity.js b/Resources/public/js/select2entity.js index 3c12516..0c2d801 100644 --- a/Resources/public/js/select2entity.js +++ b/Resources/public/js/select2entity.js @@ -40,7 +40,7 @@ cacheTimeout = $s2.data('ajax--cacheTimeout'); // no cache entry for 'term' or the cache has timed out? if (typeof cache[key] == 'undefined' || (cacheTimeout && Date.now() >= cache[key].time)) { - $.ajax(params).fail(failure).done(function (data) { + return $.ajax(params).fail(failure).done(function (data) { cache[key] = { data: data, time: cacheTimeout ? Date.now() + cacheTimeout : null