Ghost/core/server/models/index.js
Kevin Ansfield 16bfb3fa41 Added basic CRUD admin API for snippets
no issue

- standard browse/read/add/edit/destroy API endpoints for snippets resource
- updates `@tryghost/admin-api-schema` dependency to version that includes snippet definition and schemas
2020-10-16 18:02:58 +01:00

58 lines
962 B
JavaScript

/**
* Dependencies
*/
const _ = require('lodash');
// enable event listeners
require('./base/listeners');
/**
* Expose all models
*/
exports = module.exports;
const models = [
'permission',
'post',
'role',
'settings',
'session',
'tag',
'tag-public',
'user',
'author',
'invite',
'webhook',
'integration',
'api-key',
'mobiledoc-revision',
'member',
'posts-meta',
'member-stripe-customer',
'stripe-customer-subscription',
'email',
'email-batch',
'email-recipient',
'label',
'single-use-token',
'snippet',
// Action model MUST be loaded last as it loops through all of the registered models
// Please do not append items to this array.
'action'
];
function init() {
exports.Base = require('./base');
models.forEach(function (name) {
_.extend(exports, require('./' + name));
});
}
/**
* Expose `init`
*/
exports.init = init;