Skip to content

Commit 488204a

Browse files
Norwinnoerw
authored andcommitted
update TrackedTimes structs (#196) (#198)
update TrackedTimes structs for changes in go-gitea/gitea#9200 Co-authored-by: Norwin Roosen <[email protected]> Reviewed-by: 6543 <[email protected]> Reviewed-by: Andrew Thornton <[email protected]>
1 parent c0e11b3 commit 488204a

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

gitea/issue_tracked_time.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ type TrackedTime struct {
1616
ID int64 `json:"id"`
1717
Created time.Time `json:"created"`
1818
// Time in seconds
19-
Time int64 `json:"time"`
20-
UserID int64 `json:"user_id"`
21-
IssueID int64 `json:"issue_id"`
19+
Time int64 `json:"time"`
20+
// deprecated (only for backwards compatibility)
21+
UserID int64 `json:"user_id"`
22+
UserName string `json:"user_name"`
23+
// deprecated (only for backwards compatibility)
24+
IssueID int64 `json:"issue_id"`
25+
Issue *Issue `json:"issue"`
2226
}
2327

2428
// GetUserTrackedTimes list tracked times of a user
@@ -42,7 +46,11 @@ func (c *Client) GetMyTrackedTimes() ([]*TrackedTime, error) {
4246
// AddTimeOption options for adding time to an issue
4347
type AddTimeOption struct {
4448
// time in seconds
45-
Time int64 `json:"time"`
49+
Time int64 `json:"time" binding:"Required"`
50+
// optional
51+
Created time.Time `json:"created"`
52+
// optional
53+
User string `json:"user_name"`
4654
}
4755

4856
// AddTime adds time to issue with the given index

0 commit comments

Comments
 (0)