Switched GET skipSegments to use params instead of JSON.

Body is not supported for GET requests.
This commit is contained in:
Ajay Ramachandran
2020-04-09 01:19:51 -04:00
parent 08a76dc420
commit 26b9659140

View File

@@ -211,10 +211,12 @@ function getVoteOrganisedSponsorTimes(sponsorTimes, votes, UUIDs) {
* @returns * @returns
*/ */
function handleGetSegments(req, res) { function handleGetSegments(req, res) {
const videoID = req.body.videoID || req.query.videoID; const videoID = req.query.videoID;
// Default to sponsor // Default to sponsor
// If using params instead of JSON, only one category can be pulled // If using params instead of JSON, only one category can be pulled
const categories = req.body.categories || (req.query.category ? [req.query.category] : ["sponsor"]); const categories = req.query.categories ? JSON.parse(req.query.categories)
: (req.query.category ? [req.query.category] : ["sponsor"]);
/** /**
* @type {Array<{ * @type {Array<{