mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-11 00:37:55 +03:00
Add correct nomen setting and revert _post changes
This commit is contained in:
parent
c49dc73385
commit
13e7a51bb7
@ -5,6 +5,6 @@
|
||||
"trailing": true,
|
||||
"eqeqeq": true,
|
||||
"undef": true,
|
||||
"nomen": true,
|
||||
"nomen": false,
|
||||
"white": true
|
||||
}
|
@ -40,8 +40,8 @@
|
||||
var posts = JSON.parse(data),
|
||||
post;
|
||||
|
||||
_.each(posts, function (postData) {
|
||||
post = new schema.models.Post(postData);
|
||||
_.each(posts, function (_post) {
|
||||
post = new schema.models.Post(_post);
|
||||
|
||||
post.preCreate(function () {
|
||||
post.save(function (error, data) {
|
||||
@ -112,8 +112,8 @@
|
||||
* @param post
|
||||
* @param callback
|
||||
*/
|
||||
DataProvider.prototype.posts.add = function (postData, callback) {
|
||||
var post = new schema.models.Post(postData);
|
||||
DataProvider.prototype.posts.add = function (_post, callback) {
|
||||
var post = new schema.models.Post(_post);
|
||||
|
||||
post.preCreate(function () {
|
||||
post.save(callback);
|
||||
@ -125,9 +125,9 @@
|
||||
* @param post
|
||||
* @param callback
|
||||
*/
|
||||
DataProvider.prototype.posts.edit = function (postData, callback) {
|
||||
schema.models.Post.findOne({where: {id: postData.id}}, function (error, post) {
|
||||
post = _.extend(post, postData);
|
||||
DataProvider.prototype.posts.edit = function (_post, callback) {
|
||||
schema.models.Post.findOne({where: {id: _post.id}}, function (error, post) {
|
||||
post = _.extend(post, _post);
|
||||
|
||||
schema.models.Post.updateOrCreate(post, callback);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user