From f0fb843a1c9b2fee295e4bcd01b8813a1d87dd3f Mon Sep 17 00:00:00 2001 From: Daniel Aleksandersen Date: Sun, 5 Dec 2021 21:43:27 +0100 Subject: [PATCH] Switch Latest Comments API call to use GET request (cacheable) --- api/frontends/latest/constructor.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/frontends/latest/constructor.js b/api/frontends/latest/constructor.js index 2d139f0e..624d7e44 100644 --- a/api/frontends/latest/constructor.js +++ b/api/frontends/latest/constructor.js @@ -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); @@ -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');