RevisionsService: Asynchronously inject NotesService to resolve circular dependency while testing

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2020-09-25 20:42:35 +02:00
parent b9b5af8b7f
commit 5bd1259949
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3

View file

@ -1,4 +1,4 @@
import { Inject, Injectable, Logger } from '@nestjs/common';
import { forwardRef, Inject, Injectable, Logger } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { NotesService } from '../notes/notes.service';
@ -13,7 +13,7 @@ export class RevisionsService {
constructor(
@InjectRepository(Revision)
private revisionRepository: Repository<Revision>,
@Inject(NotesService) private notesService: NotesService,
@Inject(forwardRef(() => NotesService)) private notesService: NotesService,
) {}
async getNoteRevisionMetadatas(