[FIX] Current innerHTML contains text instead of str, had to change sum equation.
@@ -59,13 +59,12 @@ function initReposDataTable() {
// AJAX source info
url: "/get_repos",
dataSrc: function (json) {
- document.querySelector("#lenDiscoveries").innerText = json.length;
- document.querySelector("#allDiscoveries").innerText = json.reduce(
- (prev, curr) => prev + curr.lendiscoveries,
- 0
- );
+ document.querySelector('#lenDiscoveries').innerText = json.length;
+ document.querySelector("#allDiscoveries").innerText = 0;
// Map json data before sending it to datatable
return json.map((item) => {
+ current_total_count = parseInt(document.querySelector("#allDiscoveries").innerText);
+ document.querySelector("#allDiscoveries").innerText = current_total_count + item.total;
local_repo = !(
item.url.startsWith("http://") || item.url.startsWith("https://")
);
