Skip to content

Commit

Permalink
Switch Comment Count API call to use GET request (cacheable)
Browse files Browse the repository at this point in the history
  • Loading branch information
da2x committed Dec 5, 2021
1 parent 788ea35 commit 7668832
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/frontends/count-link/getcommentcount.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}
Expand Down

0 comments on commit 7668832

Please sign in to comment.