Support deleting feed

This commit is contained in:
2021-02-21 10:29:07 +00:00
parent ab390c9d47
commit 22db062fd9
4 changed files with 27 additions and 0 deletions

View File

@@ -33,6 +33,11 @@ func (fs *FeedStore) GetFeed(id string) *Feed {
return feed
}
func (fs *FeedStore) DeleteFeed(id string) {
fs.getDB().Delete(Feed{ID: id})
fs.getDB().Unscoped().Delete(Item{}, "feed_id = ?", id)
}
func (fs *FeedStore) GetItem(id string) *Item {
item := &Item{}
fs.getDB().Where("id = ?", id).First(item)