fix(revisions-service: user query builder

For reasons, the typeorm 0.3 broke the find()
method when using relations in the WHERE clause.
This replaces the find method with a query builder.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2022-03-27 20:34:44 +02:00
parent c4975e4783
commit 366aead689

View file

@ -34,11 +34,11 @@ export class RevisionsService {
}
async getAllRevisions(note: Note): Promise<Revision[]> {
return await this.revisionRepository.find({
where: {
note: Equal(note),
},
});
this.logger.debug(`Getting all revisions for note ${note.id}`);
return await this.revisionRepository
.createQueryBuilder('revision')
.where('revision.note = :note', { note: note.id })
.getMany();
}
/**