Skip to content

Commit

Permalink
update TrackedTimes structs (#196) (#198)
Browse files Browse the repository at this point in the history
update TrackedTimes structs

for changes in go-gitea/gitea#9200

Co-authored-by: Norwin Roosen <git@nroo.de>
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
2 people authored and lunny committed Dec 31, 2019
1 parent c0e11b3 commit 488204a
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions gitea/issue_tracked_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ type TrackedTime struct {
ID int64 `json:"id"`
Created time.Time `json:"created"`
// Time in seconds
Time int64 `json:"time"`
UserID int64 `json:"user_id"`
IssueID int64 `json:"issue_id"`
Time int64 `json:"time"`
// deprecated (only for backwards compatibility)
UserID int64 `json:"user_id"`
UserName string `json:"user_name"`
// deprecated (only for backwards compatibility)
IssueID int64 `json:"issue_id"`
Issue *Issue `json:"issue"`
}

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

// AddTime adds time to issue with the given index
Expand Down

0 comments on commit 488204a

Please sign in to comment.