1
0
mirror of https://codeberg.org/teddit/teddit synced 2025-02-18 05:00:37 +01:00

Update save.js to pass instance_config to template

This commit is contained in:
redmt 2022-06-11 19:34:54 +02:00
parent b2dba3f723
commit 55bd044b06

View File

@ -13,6 +13,7 @@ saveRoutes.get('/saved', (req, res, next) => {
return res.render('saved', { return res.render('saved', {
json: null, json: null,
user_preferences: req.cookies, user_preferences: req.cookies,
instance_config: config,
}); });
} }
@ -38,6 +39,7 @@ saveRoutes.get('/saved', (req, res, next) => {
return res.render('saved', { return res.render('saved', {
json: processed_json, json: processed_json,
user_preferences: req.cookies, user_preferences: req.cookies,
instance_config: config,
}); });
} else { } else {
return res.render('subreddit', { return res.render('subreddit', {
@ -45,6 +47,7 @@ saveRoutes.get('/saved', (req, res, next) => {
error: true, error: true,
data: processed_json, data: processed_json,
user_preferences: req.cookies, user_preferences: req.cookies,
instance_config: config,
}); });
} }
})(); })();
@ -217,6 +220,7 @@ saveRoutes.get(
return res.render('frontpage', { return res.render('frontpage', {
json: null, json: null,
user_preferences: req.cookies, user_preferences: req.cookies,
instance_config: config,
}); });
} }
if (json) { if (json) {
@ -260,6 +264,7 @@ saveRoutes.get(
return res.render('frontpage', { return res.render('frontpage', {
json: null, json: null,
user_preferences: req.cookies, user_preferences: req.cookies,
instance_config: config,
}); });
} else { } else {
console.log( console.log(
@ -291,6 +296,7 @@ saveRoutes.get(
json: null, json: null,
http_status_code: result.status, http_status_code: result.status,
user_preferences: req.cookies, user_preferences: req.cookies,
instance_config: config,
}); });
} }
}) })