diff --git a/cmd/add_test.go b/cmd/add_test.go index 293cc1a..6f04142 100644 --- a/cmd/add_test.go +++ b/cmd/add_test.go @@ -301,11 +301,11 @@ func TestAddCommandWithAllFlags(t *testing.T) { if receivedBill["payedFor"] != "2,3" { // Alice and Bob t.Errorf("Wrong payedFor: %s", receivedBill["payedFor"]) } - if receivedBill["categoryid"] != "5" { - t.Errorf("Wrong categoryid: %s", receivedBill["categoryid"]) + if receivedBill["categoryId"] != "5" { + t.Errorf("Wrong categoryid: %s", receivedBill["categoryId"]) } - if receivedBill["paymentmodeid"] != "3" { - t.Errorf("Wrong paymentmodeid: %s", receivedBill["paymentmodeid"]) + if receivedBill["paymentModeId"] != "3" { + t.Errorf("Wrong paymentmodeid: %s", receivedBill["paymentModeId"]) } if receivedBill["comment"] != "Team dinner" { t.Errorf("Wrong comment: %s", receivedBill["comment"]) diff --git a/internal/api/client.go b/internal/api/client.go index 566e0d3..eab7827 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -359,10 +359,10 @@ func (c *Client) CreateBill(projectID string, bill Bill) error { data.Set("comment", bill.Comment) } if bill.PaymentModeID != 0 { - data.Set("paymentmodeid", strconv.Itoa(bill.PaymentModeID)) + data.Set("paymentModeId", strconv.Itoa(bill.PaymentModeID)) } if bill.CategoryID != 0 { - data.Set("categoryid", strconv.Itoa(bill.CategoryID)) + data.Set("categoryId", strconv.Itoa(bill.CategoryID)) } if bill.OriginalCurrencyID != 0 { data.Set("original_currency_id", strconv.Itoa(bill.OriginalCurrencyID)) diff --git a/internal/api/client_test.go b/internal/api/client_test.go index 3d1aa58..49bf31d 100644 --- a/internal/api/client_test.go +++ b/internal/api/client_test.go @@ -283,11 +283,11 @@ func TestCreateBill(t *testing.T) { if r.FormValue("comment") != "" { t.Errorf("Comment should be empty: %s", r.FormValue("comment")) } - if r.FormValue("paymentmodeid") != "" { - t.Errorf("paymentmodeid should be empty: %s", r.FormValue("paymentmodeid")) + if r.FormValue("paymentModeId") != "" { + t.Errorf("paymentmodeid should be empty: %s", r.FormValue("paymentModeId")) } - if r.FormValue("categoryid") != "" { - t.Errorf("categoryid should be empty: %s", r.FormValue("categoryid")) + if r.FormValue("categoryId") != "" { + t.Errorf("categoryid should be empty: %s", r.FormValue("categoryId")) } }, },