0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/services/limits.js
Hannah Wolfe 26f56626ce Updated host config to correctly use camelCase
refs https://github.com/TryGhost/Team/issues/510

- When the host config was introduced it was incorrectly introduced as host_settings instead of hostSettings
- All other Ghost config uses camelCase, so changing this now before it becomes a problem
- Note: Also removed some rogue return awaits that don't make sense. It's not possible to hit that case, but cleaning up anyway
2021-03-04 11:39:32 +00:00

24 lines
750 B
JavaScript

const config = require('../../shared/config');
const db = require('../data/db');
const LimitService = require('@tryghost/limit-service');
let limitService = new LimitService();
const initFn = () => {
let helpLink;
if (!config.get('hostSettings') || !config.get('hostSettings:limits')) {
return;
}
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
helpLink = config.get('hostSettings:billing:url');
} else {
helpLink = 'https://ghost.org/help/';
}
limitService.loadLimits({limits: config.get('hostSettings:limits'), db, helpLink});
};
module.exports = limitService;
module.exports.init = initFn;