mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-14 23:22:40 +00:00
批量公开, 取消公开为博客完成
This commit is contained in:
19
node_modules/note.js
generated
vendored
19
node_modules/note.js
generated
vendored
@@ -161,7 +161,22 @@ var Note = {
|
||||
},
|
||||
|
||||
// 公开/取消为博客
|
||||
setNote2Blog: function(noteId, isBlog, callback) {
|
||||
setNote2Blog: function(noteIds, isBlog, callback) {
|
||||
var me = this;
|
||||
var ok = false;
|
||||
async.eachSeries(noteIds, function(noteId, cb) {
|
||||
me._setNote2Blog(noteId, isBlog, function (ret) {
|
||||
if (ret) {
|
||||
ok = true;
|
||||
}
|
||||
cb();
|
||||
});
|
||||
}, function () {
|
||||
callback(ok);
|
||||
});
|
||||
},
|
||||
|
||||
_setNote2Blog: function(noteId, isBlog, callback) {
|
||||
var me = this;
|
||||
me.getNote(noteId, function(note) {
|
||||
if(note) {
|
||||
@@ -169,7 +184,7 @@ var Note = {
|
||||
return callback && callback(true);
|
||||
}
|
||||
// 更新, 设置isDirty
|
||||
db.notes.update({NoteId: noteId}, { $set: {IsBlog: isBlog, IsDirty: true} }, {}, function (err, numReplaced) {
|
||||
db.notes.update({_id: note._id}, { $set: {IsBlog: isBlog, IsDirty: true} }, {}, function (err, numReplaced) {
|
||||
return callback && callback(true);
|
||||
});
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user