Merge pull request #12102 from zhulongcheng/empty-op-log
fix(http): return an empty list of operation logs if not foundpull/12157/head
commit
8a104eba28
|
|
@ -829,7 +829,7 @@ func newOrganizationLogResponse(id influxdb.ID, es []*influxdb.OperationLogEntry
|
|||
}
|
||||
return &operationLogResponse{
|
||||
Links: map[string]string{
|
||||
"self": fmt.Sprintf("/api/v2/organizations/%s/log", id),
|
||||
"self": fmt.Sprintf("/api/v2/orgs/%s/log", id),
|
||||
},
|
||||
Log: log,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -699,7 +699,7 @@ func (s *Service) GetBucketOperationLog(ctx context.Context, id influxdb.ID, opt
|
|||
})
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if err != nil && err != errKeyValueLogBoundsNotFound {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -941,7 +941,7 @@ func (s *Service) GetDashboardOperationLog(ctx context.Context, id influxdb.ID,
|
|||
})
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if err != nil && err != errKeyValueLogBoundsNotFound {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -493,7 +493,7 @@ func (s *Service) GetOrganizationOperationLog(ctx context.Context, id influxdb.I
|
|||
})
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if err != nil && err != errKeyValueLogBoundsNotFound {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ func (s *Service) GetUserOperationLog(ctx context.Context, id influxdb.ID, opts
|
|||
log := []*influxdb.OperationLogEntry{}
|
||||
|
||||
err := s.kv.View(func(tx Tx) error {
|
||||
key, err := encodeBucketOperationLogKey(id)
|
||||
key, err := encodeUserOperationLogKey(id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -469,7 +469,7 @@ func (s *Service) GetUserOperationLog(ctx context.Context, id influxdb.ID, opts
|
|||
})
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
if err != nil && err != errKeyValueLogBoundsNotFound {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue