testing if feed exists by URL

This commit is contained in:
albert
2025-07-29 01:17:56 +02:00
parent 580dae0c4d
commit f3fffa6f88
2 changed files with 25 additions and 0 deletions

View File

@ -19,4 +19,9 @@ export class ScrapingService {
async saveFeedItem(feedData: Omit<IFeed, '_id' | 'createdAt' | 'updatedAt'>): Promise<IFeed> {
return await this.feedRepository.create(feedData);
}
async feedExists(url: string): Promise<boolean> {
const existingFeed = await this.feedRepository.findByUrl(url);
return existingFeed !== null;
}
}