Added Types revision.ts

Signed-off-by: Yannick Bungers <git@innay.de>
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
Yannick Bungers 2020-04-12 19:31:51 +02:00 committed by David Mehren
parent 6d256dd5b6
commit a191448b3d
No known key found for this signature in database
GPG key ID: 6017AF117F9756CB

View file

@ -121,7 +121,7 @@ export class Revision extends Model<Revision> {
noteId: note.id noteId: note.id
}, },
order: [['createdAt', 'DESC']] order: [['createdAt', 'DESC']]
}).then(function (revisions) { }).then(function (revisions: Revision[]) {
class RevisionDataActions { // TODO: Fix Type in actions.ts class RevisionDataActions { // TODO: Fix Type in actions.ts
time time
@ -129,7 +129,7 @@ export class Revision extends Model<Revision> {
} }
const data: RevisionDataActions[] = [] const data: RevisionDataActions[] = []
revisions.forEach(function (revision) { revisions.forEach(function (revision: Revision) {
data.push({ data.push({
time: moment(revision.createdAt).valueOf(), time: moment(revision.createdAt).valueOf(),
length: revision.length length: revision.length
@ -148,7 +148,7 @@ export class Revision extends Model<Revision> {
noteId: note.id noteId: note.id
}, },
order: [['createdAt', 'DESC']] order: [['createdAt', 'DESC']]
}).then(function (revisions) { }).then(function (revisions: Revision[]) {
if (revisions.length <= 0) { if (revisions.length <= 0) {
errorCallback(null, null) errorCallback(null, null)
return return
@ -161,7 +161,7 @@ export class Revision extends Model<Revision> {
[Op.gte]: time [Op.gte]: time
} }
} }
}).then(function (count) { }).then(function (count: number) {
if (count <= 0) { if (count <= 0) {
errorCallback(null, null) errorCallback(null, null)
return return