PR review changes
parent
03c0b4c896
commit
0c68d3126f
|
@ -560,17 +560,17 @@ func decodeGetRunsRequest(ctx context.Context, r *http.Request, orgs platform.Or
|
|||
req.filter.Limit = i
|
||||
}
|
||||
|
||||
var at, bt string
|
||||
var afterTime, beforeTime time.Time
|
||||
if at := qp.Get("afterTime"); at != "" {
|
||||
if at = qp.Get("afterTime"); at != "" {
|
||||
afterTime, err = time.Parse(time.RFC3339, at)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.filter.AfterTime = at
|
||||
|
||||
}
|
||||
|
||||
if bt := qp.Get("beforeTime"); bt != "" {
|
||||
if bt = qp.Get("beforeTime"); bt != "" {
|
||||
beforeTime, err = time.Parse(time.RFC3339, bt)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -578,7 +578,7 @@ func decodeGetRunsRequest(ctx context.Context, r *http.Request, orgs platform.Or
|
|||
req.filter.BeforeTime = bt
|
||||
}
|
||||
|
||||
if &afterTime != nil && &beforeTime != nil && afterTime.Sub(beforeTime).Nanoseconds() > 0 {
|
||||
if at != "" && bt != "" && afterTime.Sub(beforeTime).Nanoseconds() > 0 {
|
||||
return nil, kerrors.InvalidDataf("beforeTime must be greater than afterTime")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue