1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-09-15 18:57:04 +00:00

fix(ui): Redirect correctly post feed removal from category feeds list

Currently, removing a feed from `/category/{id}/feeds` redirects incorrectly to `/feeds`. This change fixes it so that
removing a feed will now correctly redirect to `/category/{id}/feeds`. Removing a feed from `/feeds` is unaffected and
will work as it does currently.

To fix this, a new UI endpoint `/category/{categoryID}/feed/{feedID}/remove` is added and a corresponding handler method
to validate and perform the removal from DB.
This commit is contained in:
Sangeeth Sudheer 2025-01-27 12:56:38 +05:30 committed by Frédéric Guillot
parent fba23cf464
commit e40446ad3c
5 changed files with 44 additions and 2 deletions

View file

@ -40,6 +40,14 @@ func (s *Storage) FeedExists(userID, feedID int64) bool {
return result
}
// CategoryFeedExists returns true if the given feed exists that belongs to the given category.
func (s *Storage) CategoryFeedExists(userID, categoryID, feedID int64) bool {
var result bool
query := `SELECT true FROM feeds WHERE user_id=$1 AND category_id=$2 AND id=$3`
s.db.QueryRow(query, userID, categoryID, feedID).Scan(&result)
return result
}
// FeedURLExists checks if feed URL already exists.
func (s *Storage) FeedURLExists(userID int64, feedURL string) bool {
var result bool