mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Make stricter jshint rules, convert tabs to spaces
This commit is contained in:
parent
99c13c02c0
commit
6da08eaf3c
5 changed files with 53 additions and 48 deletions
|
@ -1,5 +1,10 @@
|
||||||
{
|
{
|
||||||
"node": true,
|
"node": true,
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"undef": true
|
"indent": 4,
|
||||||
|
"trailing": true,
|
||||||
|
"eqeqeq": true,
|
||||||
|
"undef": true,
|
||||||
|
"nomen": true,
|
||||||
|
"white": true
|
||||||
}
|
}
|
|
@ -40,8 +40,8 @@
|
||||||
var posts = JSON.parse(data),
|
var posts = JSON.parse(data),
|
||||||
post;
|
post;
|
||||||
|
|
||||||
_.each(posts, function (_post) {
|
_.each(posts, function (postData) {
|
||||||
post = new schema.models.Post(_post);
|
post = new schema.models.Post(postData);
|
||||||
|
|
||||||
post.preCreate(function () {
|
post.preCreate(function () {
|
||||||
post.save(function (error, data) {
|
post.save(function (error, data) {
|
||||||
|
@ -112,8 +112,8 @@
|
||||||
* @param post
|
* @param post
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
DataProvider.prototype.posts.add = function (_post, callback) {
|
DataProvider.prototype.posts.add = function (postData, callback) {
|
||||||
var post = new schema.models.Post(_post);
|
var post = new schema.models.Post(postData);
|
||||||
|
|
||||||
post.preCreate(function () {
|
post.preCreate(function () {
|
||||||
post.save(callback);
|
post.save(callback);
|
||||||
|
@ -125,9 +125,9 @@
|
||||||
* @param post
|
* @param post
|
||||||
* @param callback
|
* @param callback
|
||||||
*/
|
*/
|
||||||
DataProvider.prototype.posts.edit = function (_post, callback) {
|
DataProvider.prototype.posts.edit = function (postData, callback) {
|
||||||
schema.models.Post.findOne({where: {id: _post.id}}, function (error, post) {
|
schema.models.Post.findOne({where: {id: postData.id}}, function (error, post) {
|
||||||
post = _.extend(post, _post);
|
post = _.extend(post, postData);
|
||||||
|
|
||||||
schema.models.Post.updateOrCreate(post, callback);
|
schema.models.Post.updateOrCreate(post, callback);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue