Ghost/core/server/apps/proxy.js
Fabian Becker 3950c8b30a Fix for broken filters where this context was lost.
fixes #2157
- Change tests to only check for existance
- Properly bind helpers/filters to their instance
2014-02-10 01:45:24 +01:00

25 lines
687 B
JavaScript

var _ = require('lodash'),
api = require('../api'),
helpers = require('../helpers'),
filters = require('../filters');
var proxy = {
filters: {
register: filters.registerFilter.bind(filters),
unregister: filters.unregisterFilter.bind(filters)
},
helpers: {
register: helpers.registerThemeHelper.bind(helpers),
registerAsync: helpers.registerAsyncThemeHelper.bind(helpers)
},
api: {
posts: _.pick(api.posts, 'browse', 'read'),
tags: api.tags,
notifications: _.pick(api.notifications, 'add'),
settings: _.pick(api.settings, 'read')
}
};
module.exports = proxy;