From 26b965914051cc17a3e4b0420594978b174e2575 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 9 Apr 2020 01:19:51 -0400 Subject: [PATCH] Switched GET skipSegments to use params instead of JSON. Body is not supported for GET requests. --- src/routes/getSkipSegments.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/getSkipSegments.js b/src/routes/getSkipSegments.js index 4925af3..e4f624f 100644 --- a/src/routes/getSkipSegments.js +++ b/src/routes/getSkipSegments.js @@ -211,10 +211,12 @@ function getVoteOrganisedSponsorTimes(sponsorTimes, votes, UUIDs) { * @returns */ function handleGetSegments(req, res) { - const videoID = req.body.videoID || req.query.videoID; + const videoID = req.query.videoID; // Default to sponsor // 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<{