API light mode subreddit

This commit is contained in:
gawii0 2021-12-24 15:37:46 +01:00
parent 8315ad3f16
commit aa3a854b6e
1 changed files with 6 additions and 1 deletions

View File

@ -9,7 +9,8 @@ module.exports = function () {
from,
api_type,
api_target,
subreddit
subreddit,
mode
) => {
if (!config.api_enabled) {
res.setHeader('Content-Type', 'application/json');
@ -182,6 +183,10 @@ module.exports = function () {
}
}
if (mode === 'light') {
processed_json.selftext_html = null;
}
return res.end(JSON.stringify(processed_json));
}
}