Collection should default to username
Closed, WontfixPublic


Currently with other instances, a new post is created under drafts. It should be the users name when no collection was specified.

Event Timeline

robjloranger moved this task from Backlog to In Progress on the WriteFreely CLI board.
robjloranger triaged this task as Medium-High priority.

in go-writeas PostParams tells JSON to ignore the Collection field

robjloranger moved this task from Backlog to Next Up on the API Library: Go board.

fixed upstream issue, v2.0.1

matt added a comment.Jun 13 2019, 1:12 PM

So, the PostParams.Collection field was left out of the JSON because it shouldn't ever get sent along with the payload. Instead it's used to set the API endpoint in go-writeas, e.g. /api/collections/{Collection}/posts. Is there another reason it's needed in the JSON?

Sorry I missed that part. I admit I was eager to do some work yesterday.

The reason is it wasn't working without it present, which is weird. The posts still went up as drafts. I can test again using the previous version.

matt added a comment.Jun 13 2019, 1:53 PM

No worries. Yeah, the library should be taking the parameter and using it to change the endpoint, as is done here in post.go

OK, let's revert that commit and I will test more to see what the real problem is.

matt added a comment.Jun 13 2019, 1:56 PM

Sounds good. I'll go ahead and revert it.

ok, super strange but it does work now without the collection being sent.

matt closed this task as Wontfix.Fri, Sep 20, 3:56 PM

As mentioned in this GitHub comment, we want to support posting drafts with wf-cli, so we don't want this behavior.