Changed Config API response structure

refs: https://github.com/TryGhost/Team/issues/510

- Changed to return the full hostSettings key, not just the billing URL
- We are introducing several more settings that are needed by Admin including limits
- Passing the whole object makes this much easier to reason about as Admin has the exact same config as the server
This commit is contained in:
Hannah Wolfe 2021-03-04 20:42:02 +00:00
parent bdc4d4a0d4
commit 6f579331e1

View File

@ -9,7 +9,6 @@ module.exports = {
read: {
permissions: false,
query() {
const billingUrl = config.get('hostSettings:billing:enabled') ? config.get('hostSettings:billing:url') : '';
const response = {
version: ghostVersion.full,
environment: config.get('env'),
@ -21,11 +20,9 @@ module.exports = {
enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false,
stripeDirect: config.get('stripeDirect'),
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun,
emailAnalytics: config.get('emailAnalytics')
emailAnalytics: config.get('emailAnalytics'),
hostSettings: config.get('hostSettings')
};
if (billingUrl) {
response.billingUrl = billingUrl;
}
return response;
}
}