~thrrgilag/woodstock

721875def20757f46aa04c374628a7aa20fa162a — Morgan McMillian 3 years ago a7a3110
fix endpoint for user and post interactions resolves issue #1
2 files changed, 4 insertions(+), 4 deletions(-)

M posts.go
M users.go
M posts.go => posts.go +2 -2
@@ 179,7 179,7 @@ func (c *Client) UnBookmark(id string) (result PostResult, err error) {
}

// GetActions retrieves actions
// https://pnut.io/docs/api/resources/posts/actions#get-posts-id-actions
// https://pnut.io/docs/api/resources/posts/interactions#get-posts-id-interactions
func (c *Client) GetActions(id string, v ...url.Values) (result ActionsResult, err error) {
	param := ""
	if len(v) > 0 {


@@ 189,6 189,6 @@ func (c *Client) GetActions(id string, v ...url.Values) (result ActionsResult, e
		param = "?" + param
	}
	responseCh := make(chan response)
	c.queryQueue <- query{url: PostAPI + "/" + id + "/actions" + param, data: &result, method: "GET", responseCh: responseCh}
	c.queryQueue <- query{url: PostAPI + "/" + id + "/interactions" + param, data: &result, method: "GET", responseCh: responseCh}
	return result, (<-responseCh).err
}

M users.go => users.go +2 -2
@@ 307,7 307,7 @@ func (c *Client) GetBookmarks(id string, count ...int) (result PostsResult, err 
}

// GetActionsForMe retireve a users actions
// https://pnut.io/docs/api/resources/posts/actions#get-posts-id-actions
// https://pnut.io/docs/api/resources/users/interactions#get-users-me-interactions
func (c *Client) GetActionsForMe(v ...url.Values) (result ActionsResult, err error) {
	param := ""
	if len(v) > 0 {


@@ 317,7 317,7 @@ func (c *Client) GetActionsForMe(v ...url.Values) (result ActionsResult, err err
		param = "?" + param
	}
	responseCh := make(chan response)
	c.queryQueue <- query{url: UserMeAPI + "/actions" + param, data: &result, method: "GET", responseCh: responseCh}
	c.queryQueue <- query{url: UserMeAPI + "/interactions" + param, data: &result, method: "GET", responseCh: responseCh}
	return result, (<-responseCh).err
}