Conversation
card.go
Outdated
|
|
||
| // MoveToList will move the card to another list | ||
| // https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-idlist | ||
| func (c *Card) MoveToList(listId string) ([]byte, error) { |
There was a problem hiding this comment.
Should we have two methods
func (c *Card) MoveToListID(listId string) ([]byte, error)
func (c *Card) MoveToList(list *List) ([]byte, error)?
There was a problem hiding this comment.
I'd keep this to one of those methods to avoid confusion. In the end I don't have a preference for one of them…
There was a problem hiding this comment.
Good. I that case, let's do
func (c *Card) MoveToList(list *List) (*Card, error)
and we'll also have
func (c *Card) MoveToBoard(board *Board) (*Card, error)
in future
|
LGTM other than the minor questions/comments. Can you answer them pls? Thanks for your contribution! |
card.go
Outdated
|
|
||
| // Archive will archive the card | ||
| // https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-closed | ||
| func (c *Card) Archive() ([]byte, error) { |
There was a problem hiding this comment.
I'd like to add some real response types for all these methods (instead of []byte). What's the response from Trello?
There was a problem hiding this comment.
Will figure out. The documentation doesn't say anything about this but 👍 for not longer passing back []byte :)
There was a problem hiding this comment.
Seems like it returns modified card. So let's return *Card.
|
Please ignore the failing tests. They are fixed in another PR. Also, @VojtechVitek, let me set the API key and token in the Travis repository, or perhaps you can set them yourself, with your account, by just joining the board: https://trello.com/b/iZVEfBeQ/go-trello-test-board It's very annoying, but I am writing tests considering that the Board will be left the same way it was before the test suite was run. For example, if during the test you add a card, on a subsequent test case you have to delete that same card. I can't think of a better way to do it. @Luzifer what do you think of this approach? It's dangerous that someone can create a test that doesn't meet this criteria and submit a PR, the test will be run by Travis and the board will be messed up. |
|
@fiatjaf can't we create new board for each test? |
|
That's a good idea, but I think this would configure an abusive usage, since Trello boards can't be deleted. |
fix struct instantiation on card methods.
No description provided.