-
Notifications
You must be signed in to change notification settings - Fork 2
Description
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).