More static methods in revision.ts

Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
David Mehren 2020-04-11 00:34:18 +02:00
parent 0c078f5266
commit 4e02f46cee
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -151,7 +151,7 @@ export class Revision extends Model<Revision> {
return callback(err, null)
})
}
checkAllNotesRevision (callback) {
static checkAllNotesRevision (callback) {
this.saveAllNotesRevision(function (err, notes) {
if (err) return callback(err, null)
if (!notes || notes.length <= 0) {
@ -161,8 +161,8 @@ export class Revision extends Model<Revision> {
}
})
}
saveAllNotesRevision (callback) {
Sequelize.models.Note.findAll({
static saveAllNotesRevision (callback) {
Note.findAll({
// query all notes that need to save for revision
where: {
[Op.and]: [