add: go back button in rankings
All checks were successful
Deploy on push / deploy (push) Has been skipped
All checks were successful
Deploy on push / deploy (push) Has been skipped
This commit is contained in:
@@ -8,6 +8,7 @@ const {
|
||||
loadRankingsState,
|
||||
recordVote,
|
||||
resetRankingsState,
|
||||
undoLastRankingsVote,
|
||||
} = require("./lib/rankings-state");
|
||||
|
||||
const DEFAULT_HOST = "127.0.0.1";
|
||||
@@ -195,7 +196,17 @@ async function handleApiRequest(request, response, pathname, options) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pathname === "/api/rankings" || pathname === "/api/rankings/vote" || pathname === "/api/rankings/reset") {
|
||||
if (pathname === "/api/rankings/undo" && request.method === "POST") {
|
||||
sendJson(response, 200, undoLastRankingsVote({ statePath: options.rankingsStatePath }));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (
|
||||
pathname === "/api/rankings" ||
|
||||
pathname === "/api/rankings/vote" ||
|
||||
pathname === "/api/rankings/reset" ||
|
||||
pathname === "/api/rankings/undo"
|
||||
) {
|
||||
sendText(response, 405, "Method not allowed");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user