You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a post is pinned to a collection, it does not appear in the collection's post list.
Steps to reproduce (if necessary)
Steps to reproduce the behavior:
Create a new post.
Pin it to a collection.
Hit the /api/collections/{collection}/posts endpoint.
Observe that the pinned posts is not included in .data.posts.
Expected behavior
Ideally, pinned posts would either be included in the listing by default, or a "pinned=true" query parameter or similar would let me ask WriteFreely to include them.
If this line in the source had its last argument as true instead of false, that'd solve my immediate problem.
Thanks for reporting this. Can you share a bit more about your use case, so I can understand why you might want pinned posts at that endpoint? Right now, it's designed to only provide a feed of posts.
My use case was that I wanted to have a WriteFreely blog where the content is externally managed: as in, have a directory full of markdown files, which a script would sync to my WriteFreely instance, add them to the relevant collections, pin them if necessary, and so on. Part of this sync was deleting obsolete posts. I originally wanted to implement this by listing posts in the main collection (I only used one), but ran into this problem, that pinned posts weren't listed there, so I couldn't delete obsolete ones (I did not wish to keep track of post IDs already posted: everything that's not in the source repo should be considered obsolete, and to be deleted).
I eventually switched to /api/me/posts, which did list the pinned ones too, and worked in my case (I had a single user, with a single collection). It would have been a lot more annoying if I had multiple users - still doable, but more annoying.
This particular case would be nicely supported if /api/collections/{collection}/posts would take a pinned=true query parameter, because then the use case would work for collections that have posts from multiple users, too.
Describe the bug
When a post is pinned to a collection, it does not appear in the collection's post list.
Steps to reproduce (if necessary)
Steps to reproduce the behavior:
/api/collections/{collection}/posts
endpoint..data.posts
.Expected behavior
Ideally, pinned posts would either be included in the listing by default, or a "pinned=true" query parameter or similar would let me ask WriteFreely to include them.
If this line in the source had its last argument as
true
instead offalse
, that'd solve my immediate problem.Application configuration
Version or last commit: 3e7d236
The text was updated successfully, but these errors were encountered: