Skip to content

Commit 4b3a242

Browse files
committed
Fix: Timelog - Allow omitting the billable field
When the billable field isn't provided the tasklist or project configuration will be used instead.
1 parent f4ba3a0 commit 4b3a242

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

projects/timelog.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ type TimelogCreateRequest struct {
143143
// they will be summed up to calculate the total time logged.
144144
Minutes int64 `json:"minutes"`
145145

146-
// Billable indicates whether the timelog is billable or not.
147-
Billable bool `json:"isBillable"`
146+
// Billable indicates whether the timelog is billable or not. When not
147+
// provided, it will default to the tasklist or project settings.
148+
Billable *bool `json:"isBillable"`
148149

149150
// UserID is an optional ID of the user who logged the timelog. If not
150151
// provided, the timelog will be logged by the user making the request.

projects/timelog_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestTimelogCreate(t *testing.T) {
4343
IsUTC: true,
4444
Hours: 2,
4545
Minutes: 30,
46-
Billable: true,
46+
Billable: new(true),
4747
UserID: &testResources.UserID,
4848
TagIDs: []int64{testResources.TagID},
4949
},
@@ -59,7 +59,7 @@ func TestTimelogCreate(t *testing.T) {
5959
IsUTC: true,
6060
Hours: 2,
6161
Minutes: 30,
62-
Billable: true,
62+
Billable: new(true),
6363
UserID: &testResources.UserID,
6464
TagIDs: []int64{testResources.TagID},
6565
},

0 commit comments

Comments
 (0)