writefreely / writefreely-swift

A Swift package wrapping the WriteFreely / Write.as API
BSD 3-Clause "New" or "Revised" License
9 stars 1 forks source link

The movePost() API endpoint should be able to move posts to "Drafts" #23

Closed AngeloStavrow closed 4 years ago

AngeloStavrow commented 4 years ago

Per comments from @thebaer, to remove a post from a collection (i.e., turn it into a Draft):

Basically, you pass an array of post IDs to POST /api/posts/disperse. That un-associates them with any collection. And the result is sent back in the same format as the /collect endpoint.

Currently, the method signature for moving a post to a collection is:

movePost(_ postId: String, to collectionAlias: String, completion: (Result<Bool, Error>) -> Void) 

Make the collectionAlias parameter an optional, and then pass in nil if we want to disperse a post to Drafts.