1
0
mirror of https://codeberg.org/teddit/teddit synced 2025-01-18 04:56:59 +01:00

Update inc/initRedditApi.js to pass instance_config to template

This commit is contained in:
redmt 2022-06-11 19:34:07 +02:00
parent afbad4ae3b
commit 69a9b0e080

View File

@ -30,7 +30,7 @@ module.exports = function(fetch) {
} else {
console.error(`Something went wrong while trying to get an access token from reddit API. ${result.status} ${result.statusText}`)
console.error(reddit_api_error_text)
return res.render('frontpage', { json: null, http_status_code: result.status })
return res.render('frontpage', { json: null, http_status_code: result.status, instance_config: config })
}
}).catch(error => {
console.log(`Error while obtaining a reddit API key.`, error)
@ -66,7 +66,7 @@ module.exports = function(fetch) {
} else {
console.error(`Something went wrong while fetching data from reddit API. ${result.status} ${result.statusText}`)
console.error(reddit_api_error_text)
return res.render('frontpage', { json: null, http_status_code: result.status })
return res.render('frontpage', { json: null, http_status_code: result.status, instance_config: config })
}
}).catch(error => {
console.log(`Error while refreshing the reddit API key.`, error)