aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcgi/user.cgi3
-rw-r--r--static/bv/bracket.js2
2 files changed, 3 insertions, 2 deletions
diff --git a/cgi/user.cgi b/cgi/user.cgi
index 535e580..b0a5017 100755
--- a/cgi/user.cgi
+++ b/cgi/user.cgi
@@ -93,5 +93,6 @@ when /^\/stuff-i-want/
page("Stuff I Want")
when /^\/bracket-api/
load "bracket-api.cgi"
- $cgi.out("application/json") { $pdata }
+ sts = $pdata == "null" ? "NOT_FOUND" : "OK"
+ $cgi.out("type" => "application/json", "status" => sts) { $pdata }
end
diff --git a/static/bv/bracket.js b/static/bv/bracket.js
index 0d42747..12383d4 100644
--- a/static/bv/bracket.js
+++ b/static/bv/bracket.js
@@ -879,7 +879,7 @@ class BracketCityRank {
}
// Find the most recent puzzle date
- const latestPuzzleDate = puzzles.reduce((latest, current) => {
+ const latestPuzzleDate = puzzles.map(p => p.puzzleDate).reduce((latest, current) => {
return latest > current ? latest : current;
});