У меня есть:
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/sequelize';
import { Conversation } from './conversation.model'
import { FindConversationsDto } from '../dto/conversations.find'
@Injectable()
export class ConversationsService {
constructor(
@InjectModel(Conversation)
private conversationModel: typeof Conversation
) { }
async findConversations(queryParams: FindConversationsDto): Promise<Conversation[]> {
return new Promise((resolve) => [])
// return await this.conversationModel.findAll();
}
}
И я получаю эту странную ошибку:
Nest can't resolve dependencies of the ConversationsService (?). Please make sure that the argument ConversationRepository at index [0] is available in the ConversationsModule context.
Potential solutions:
- If ConversationRepository is a provider, is it part of the current ConversationsModule?
- If ConversationRepository is exported from a separate @Module, is that module imported within ConversationsModule?
@Module({
imports: [ /* the Module containing ConversationRepository */ ]
})
ConversationModule
это:
import { Module } from '@nestjs/common';
import { ConversationsController } from './conversations.controller';
import { ConversationsService } from './conversations.service';
@Module({
controllers: [ConversationsController],
providers: [ConversationsService]
})
export class ConversationsModule {}
Не уверен, что ConversationRepository
имеет в виду.