test Scraping Service adding item to repo
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { IFeedRepository } from '../repositories/FeedRepository';
|
||||
import { IFeed } from '../types/Feed';
|
||||
|
||||
export class ScrapingService {
|
||||
constructor(private feedRepository: IFeedRepository) {}
|
||||
@ -14,4 +15,8 @@ export class ScrapingService {
|
||||
async getFeedCount(): Promise<number> {
|
||||
return await this.feedRepository.count();
|
||||
}
|
||||
|
||||
async saveFeedItem(feedData: Omit<IFeed, '_id' | 'createdAt' | 'updatedAt'>): Promise<IFeed> {
|
||||
return await this.feedRepository.create(feedData);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user