Skip to content

Commit

Permalink
AddCard to bottom by default (instead of top)
Browse files Browse the repository at this point in the history
  • Loading branch information
TJM committed Oct 21, 2020
1 parent 724c9c5 commit 1db4267
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion list.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ func (l *List) AddCard(opts Card) (*Card, error) {
payload := url.Values{}
payload.Set("name", opts.Name)
payload.Set("desc", opts.Desc)
payload.Set("pos", strconv.FormatFloat(opts.Pos, 'g', -1, 64))
if opts.Pos == 0.0 {
payload.Set("pos", "bottom")
} else {
payload.Set("pos", strconv.FormatFloat(opts.Pos, 'g', -1, 64))
}
payload.Set("due", opts.Due)
payload.Set("idList", opts.IdList)
payload.Set("idMembers", strings.Join(opts.IdMembers, ","))
Expand Down

0 comments on commit 1db4267

Please sign in to comment.