Skip to content

Commit a8f80f7

Browse files
committed
Switch Latest Comments API call to use GET request (cacheable)
1 parent 3830629 commit a8f80f7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

api/frontends/latest/constructor.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ function HashOverLatest (id, options, instance)
3434
// Use given instance or instance count
3535
var instance = specific ? instance : HashOverLatest.instanceCount;
3636

37-
// Backend request path
38-
var requestPath = HashOverLatest.backendPath + '/latest-ajax.php';
39-
4037
// Get backend queries
4138
var backendQueries = this.getBackendQueries (options, instance, false);
4239

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

52+
// Backend request path
53+
var requestPath = HashOverLatest.backendPath + '/latest-ajax.php?' + queries.sort.join('&');
54+
5555
// Handle backend request
56-
this.ajax ('POST', requestPath, queries, function (json) {
56+
this.ajax ('GET', requestPath, null, function (json) {
5757
// Given element ID or default
5858
var id = id || hashover.prefix ('latest');
5959

0 commit comments

Comments
 (0)