bigbluebutton-Github/bigbluebutton-html5/imports/api/note/server/modifiers/updateNote.js

29 lines
595 B
JavaScript
Raw Normal View History

2019-06-01 04:02:33 +08:00
import Note from '/imports/api/note';
import Logger from '/imports/startup/server/logger';
import { check } from 'meteor/check';
export default function updateNote(noteId, revs) {
check(noteId, String);
check(revs, Number);
const selector = {
noteId,
};
const modifier = {
$set: {
revs,
},
};
const cb = (err) => {
if (err) {
return Logger.error('Notes: error when updating note pad', { err });
2019-06-01 04:02:33 +08:00
}
return Logger.verbose('Notes: update note pad', { pad: noteId, revs });
2019-06-01 04:02:33 +08:00
};
return Note.update(selector, modifier, { multi: true }, cb);
}