0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Merge pull request #6159 from bhops/cleanup

Remove undefined function in middleware
This commit is contained in:
Sebastian Gierlinger 2015-12-02 10:00:31 +01:00
commit e5e5b1138a
4 changed files with 3 additions and 4 deletions

View file

@ -357,7 +357,7 @@ settings = {
/**
* ### Edit
* Update properties of a post
* Update properties of a setting
* @param {{settings: }} object Setting or a single string name
* @param {{id (required), include,...}} options (optional) or a single string value
* @return {Promise(Setting)} Edited Setting

View file

@ -43,7 +43,6 @@ middleware = {
authenticateUser: auth.authenticateUser,
requiresAuthorizedUser: auth.requiresAuthorizedUser,
requiresAuthorizedUserPublicAPI: auth.requiresAuthorizedUserPublicAPI,
generateAccessToken: auth.generateAccessToken,
errorHandler: errors.handleAPIError
}
};

View file

@ -49,7 +49,7 @@ Role = ghostBookshelf.Model.extend({
if (_.isNumber(roleModelOrId) || _.isString(roleModelOrId)) {
// Grab the original args without the first one
origArgs = _.toArray(arguments).slice(1);
// Get the actual post model
// Get the actual role model
return this.findOne({id: roleModelOrId, status: 'all'}).then(function then(foundRoleModel) {
// Build up the original args but substitute with actual model
var newArgs = [foundRoleModel].concat(origArgs);

View file

@ -445,7 +445,7 @@ User = ghostBookshelf.Model.extend({
if (_.isNumber(userModelOrId) || _.isString(userModelOrId)) {
// Grab the original args without the first one
origArgs = _.toArray(arguments).slice(1);
// Get the actual post model
// Get the actual user model
return this.findOne({id: userModelOrId, status: 'all'}, {include: ['roles']}).then(function then(foundUserModel) {
// Build up the original args but substitute with actual model
var newArgs = [foundUserModel].concat(origArgs);