Skip to content
This repository has been archived by the owner on Apr 2, 2022. It is now read-only.

more card actions #19

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

more card actions #19

wants to merge 15 commits into from

Conversation

fiatjaf
Copy link
Contributor

@fiatjaf fiatjaf commented Feb 21, 2016

No description provided.


// 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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have two methods

func (c *Card) MoveToListID(listId string) ([]byte, error)
func (c *Card) MoveToList(list *List) ([]byte, error)

?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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…

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@VojtechVitek
Copy link
Owner

LGTM other than the minor questions/comments. Can you answer them pls? Thanks for your contribution!


// 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) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to add some real response types for all these methods (instead of []byte). What's the response from Trello?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will figure out. The documentation doesn't say anything about this but 👍 for not longer passing back []byte :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it returns modified card. So let's return *Card.

@fiatjaf
Copy link
Contributor Author

fiatjaf commented Feb 26, 2016

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.

@VojtechVitek
Copy link
Owner

@fiatjaf can't we create new board for each test?

@fiatjaf
Copy link
Contributor Author

fiatjaf commented Feb 26, 2016

That's a good idea, but I think this would configure an abusive usage, since Trello boards can't be deleted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants