From 766883230612f535f3ff6e9f899fdd9c51496f07 Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Sun, 5 Dec 2021 21:56:12 +0100 Subject: [PATCH] Switch Comment Count API call to use GET request (cacheable) --- api/frontends/count-link/getcommentcount.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/frontends/count-link/getcommentcount.js b/api/frontends/count-link/getcommentcount.js index 82725f0c..7dbeda1f 100644 --- a/api/frontends/count-link/getcommentcount.js +++ b/api/frontends/count-link/getcommentcount.js @@ -7,17 +7,17 @@ HashOverCountLink.prototype.getCommentCount = function (link, settings) // Get backend queries var queries = ['url=' + encodeURIComponent (link.href)]; - // Backend request path - var requestPath = HashOverCountLink.backendPath + '/count-link-ajax.php'; - // Get cfg URL queries array var cfgQueries = HashOverCountLink.cfgQueries (settings); // And add cfg queries queries = queries.concat (cfgQueries); + // Backend request path + var requestPath = HashOverCountLink.backendPath + '/count-link-ajax.php?' + queries.sort ().join ('&'); + // Handle backend request - this.ajax ('POST', requestPath, queries, function (json) { + this.ajax ('GET', requestPath, null, function (json) { if (json['link-text'] !== undefined) { link.textContent = json['link-text']; }