1
0
Fork 0

fix: Honor hide_globally when creating a new feed through the api

TestGetGlobalEntriesEndpoint was failing because CreateFeed ignored HideGlobally, this fixes that.
This commit is contained in:
Pontus Jensen Karlsson 2024-08-08 04:48:41 +00:00 committed by Frédéric Guillot
parent 6fb7e84ce1
commit ade412f453
2 changed files with 11 additions and 0 deletions

View file

@ -2011,6 +2011,16 @@ func TestGetGlobalEntriesEndpoint(t *testing.T) {
t.Fatal(err)
}
feedIDEntry, err := regularUserClient.Feed(feedID)
if err != nil {
t.Fatal(err)
}
if feedIDEntry.HideGlobally != true {
t.Fatalf(`Expected feed to have globally_hidden set to true, was false.`)
}
/* Not filtering on GloballyVisible should return all entries */
feedEntries, err := regularUserClient.Entries(&miniflux.Filter{FeedID: feedID})

View file

@ -169,6 +169,7 @@ func CreateFeed(store *storage.Storage, userID int64, feedCreationRequest *model
subscription.BlocklistRules = feedCreationRequest.BlocklistRules
subscription.KeeplistRules = feedCreationRequest.KeeplistRules
subscription.UrlRewriteRules = feedCreationRequest.UrlRewriteRules
subscription.HideGlobally = feedCreationRequest.HideGlobally
subscription.EtagHeader = responseHandler.ETag()
subscription.LastModifiedHeader = responseHandler.LastModified()
subscription.FeedURL = responseHandler.EffectiveURL()