Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getPost(bySlug:from:completion:) endpoint does not return collection alias #20

Open
AngeloStavrow opened this issue Sep 10, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@AngeloStavrow
Copy link
Collaborator

AngeloStavrow commented Sep 10, 2020

This isn't exactly a bug — the Write.as/WriteFreely API doesn't return collection information on the GET /api/collections/{COLLECTION_ALIAS}/posts/{SLUG} endpoint (or GET /api/posts/{POST_ID}, for that matter), so technically this method on WFClient follows that behaviour.

It does, however, mean that you get back a WFPost whose collectionAlias property is nil — which is unexpected, given that you asked the API to fetch a post from some specific collection.

And so, I'm categorizing this as a bug: on success, the method should insert the collection alias that it was given back into the WFPost object that is returned to the completion handler.

Workaround: Don't overwrite the post's collection alias in your client's completion handler for this method (or, keep a reference to that collection alias, and re-insert it into your client's post type).

@AngeloStavrow AngeloStavrow added the bug Something isn't working label Sep 10, 2020
@AngeloStavrow AngeloStavrow added the hacktoberfest Eligible for Hacktoberfest 2023 label Sep 21, 2023
@AngeloStavrow AngeloStavrow removed the hacktoberfest Eligible for Hacktoberfest 2023 label Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant