Enable moving posts to Drafts

This commit is contained in:
Angelo Stavrow 2020-10-08 16:17:57 -04:00
parent 48625d4091
commit 5a488a2a70
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 4 additions and 12 deletions

View File

@ -179,16 +179,8 @@ extension WriteFreelyModel {
guard let loggedInClient = client,
let postId = post.postId else { return }
if let newCollectionAlias = newCollection?.alias {
post.collectionAlias = newCollectionAlias
loggedInClient.movePost(postId: postId, to: newCollectionAlias, completion: movePostHandler)
} else {
// Moving a post to Drafts is not yet supported by the Swift package.
DispatchQueue.main.async {
post.collectionAlias = oldCollection?.alias
self.selectedPost = nil
}
}
post.collectionAlias = newCollection?.alias
loggedInClient.movePost(postId: postId, to: newCollection?.alias, completion: movePostHandler)
}
}

View File

@ -1140,8 +1140,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "git@github.com:writeas/writefreely-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.1.1;
branch = "extend-move-api-to-drafts";
kind = branch;
};
};
/* End XCRemoteSwiftPackageReference section */