Skip to content

Commit

Permalink
Switch Latest Comments 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 103b5e9 commit f0fb843
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api/frontends/latest/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ function HashOverLatest (id, options, instance)
// Use given instance or instance count
var instance = specific ? instance : HashOverLatest.instanceCount;

// Backend request path
var requestPath = HashOverLatest.backendPath + '/latest-ajax.php';

// Get backend queries
var backendQueries = this.getBackendQueries (options, instance, false);

Expand All @@ -52,8 +49,11 @@ function HashOverLatest (id, options, instance)
this.options = options;
this.queries = backendQueries;

// Backend request path
var requestPath = HashOverLatest.backendPath + '/latest-ajax.php?' + queries.sort.join('&');

// Handle backend request
this.ajax ('POST', requestPath, queries, function (json) {
this.ajax ('GET', requestPath, null, function (json) {
// Given element ID or default
var id = id || hashover.prefix ('latest');

Expand Down

0 comments on commit f0fb843

Please sign in to comment.