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

Commit 81918e9

Browse files
committed
Merge pull request #1 from websitesfortrello/movetopos
More simple card actions
2 parents 255b5e0 + 9b5ea97 commit 81918e9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

card.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,15 @@ func (c *Card) Archive() ([]byte, error) {
189189
return c.client.Put("/cards/"+c.Id+"/closed", payload)
190190
}
191191

192+
// SendToBoard will dearchive the card, or send the card to the board back from archive
193+
// https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-closed
194+
func (c *Card) SendToBoard() ([]byte, error) {
195+
payload := url.Values{}
196+
payload.Set("value", "false")
197+
198+
return c.client.Put("/cards/"+c.Id+"/closed", payload)
199+
}
200+
192201
// MoveToList will move the card to another list
193202
// https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-idlist
194203
func (c *Card) MoveToList(listId string) ([]byte, error) {
@@ -197,3 +206,12 @@ func (c *Card) MoveToList(listId string) ([]byte, error) {
197206

198207
return c.client.Put("/cards/"+c.Id+"/idList", payload)
199208
}
209+
210+
// MoveToPos will move card to the specified position
211+
// https://developers.trello.com/advanced-reference/card#put-1-cards-card-id-or-shortlink-pos
212+
func (c *Card) MoveToPos(pos string) ([]byte, error) {
213+
payload := url.Values{}
214+
payload.Set("value", pos)
215+
216+
return c.client.Put("/cards/"+c.Id+"/pos", payload)
217+
}

0 commit comments

Comments
 (0)