From 2e030e2c4b612ca21b7f7019f9c0e25050b12be6 Mon Sep 17 00:00:00 2001 From: gawii0 Date: Tue, 28 Dec 2021 22:58:34 +0100 Subject: [PATCH] Fix: API light mode subreddit --- inc/teddit_api/handleSubreddit.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/teddit_api/handleSubreddit.js b/inc/teddit_api/handleSubreddit.js index fd2d334..98fd0ac 100644 --- a/inc/teddit_api/handleSubreddit.js +++ b/inc/teddit_api/handleSubreddit.js @@ -181,12 +181,12 @@ module.exports = function () { link.images.thumb = `${protocol}://${config.domain}${link.images.thumb}`; } } + + if (mode === 'light') { + link.selftext_html = null; + } } - if (mode === 'light') { - processed_json.selftext_html = null; - } - return res.end(JSON.stringify(processed_json)); } }