NotesService: Get note creation time from database

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-01-10 18:22:30 +01:00
parent 32feb5ee10
commit 65c76d0998
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
2 changed files with 17 additions and 3 deletions

View file

@ -62,6 +62,17 @@ export class RevisionsService {
});
}
getFirstRevision(noteId: string): Promise<Revision> {
return this.revisionRepository.findOne({
where: {
note: noteId,
},
order: {
createdAt: 'ASC',
},
});
}
toMetadataDto(revision: Revision): RevisionMetadataDto {
return {
id: revision.id,