Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
cd1e3f03
Unverified
Commit
cd1e3f03
authored
Jan 30, 2019
by
Sander van Harmelen
Committed by
GitHub
Jan 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #554 from sirlatrom/contribution-events-before-after-isotime-fix
Fix ISOTime encoding in GET requests
parents
e0e1ddfe
02c5e686
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
events.go
events.go
+5
-5
gitlab.go
gitlab.go
+9
-0
No files found.
events.go
View file @
cd1e3f03
...
...
@@ -71,11 +71,11 @@ type ContributionEvent struct {
// https://docs.gitlab.com/ce/api/events.html#get-user-contribution-events
type
ListContributionEventsOptions
struct
{
ListOptions
Action
*
EventTypeValue
`json:"action,omitempty"`
TargetType
*
EventTargetTypeValue
`json:"target_type,omitempty"`
Before
*
string
`
json:"before,omitempty"`
After
*
string
`
json:"after,omitempty"`
Sort
*
string
`json:"sort,omitempty"`
Action
*
EventTypeValue
`
url:"action,omitempty"
json:"action,omitempty"`
TargetType
*
EventTargetTypeValue
`
url:"target_type,omitempty"
json:"target_type,omitempty"`
Before
*
ISOTime
`url:"before,omitempty"
json:"before,omitempty"`
After
*
ISOTime
`url:"after,omitempty"
json:"after,omitempty"`
Sort
*
string
`
url:"sort,omitempty"
json:"sort,omitempty"`
}
// ListUserContributionEvents retrieves user contribution events
...
...
gitlab.go
View file @
cd1e3f03
...
...
@@ -123,6 +123,15 @@ func (t *ISOTime) UnmarshalJSON(data []byte) error {
return
err
}
// EncodeValues implements the query.Encoder interface
func
(
t
*
ISOTime
)
EncodeValues
(
key
string
,
v
*
url
.
Values
)
error
{
if
t
==
nil
||
(
time
.
Time
(
*
t
))
.
IsZero
()
{
return
nil
}
v
.
Add
(
key
,
t
.
String
())
return
nil
}
// String implements the Stringer interface
func
(
t
ISOTime
)
String
()
string
{
return
time
.
Time
(
t
)
.
Format
(
iso8601
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment