fix: empty notebooks list returns empty array (#21588)
parent
75594094f5
commit
b928d3bda4
|
@ -137,7 +137,7 @@ func (s *Service) DeleteNotebook(ctx context.Context, id platform.ID) error {
|
|||
// ListNotebooks lists notebooks matching the provided filter. Currently, only org_id is used in the filter.
|
||||
// Future uses may support pagination via this filter as well.
|
||||
func (s *Service) ListNotebooks(ctx context.Context, filter influxdb.NotebookListFilter) ([]*influxdb.Notebook, error) {
|
||||
var ns []*influxdb.Notebook
|
||||
ns := []*influxdb.Notebook{}
|
||||
|
||||
query := `
|
||||
SELECT id, org_id, name, spec, created_at, updated_at
|
||||
|
|
|
@ -154,7 +154,7 @@ func TestList(t *testing.T) {
|
|||
// selecting with no matches for org_id should return an empty list and no error
|
||||
got, err := svc.ListNotebooks(ctx, influxdb.NotebookListFilter{OrgID: orgID})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 0, len(got))
|
||||
require.Equal(t, []*influxdb.Notebook{}, got)
|
||||
|
||||
// create some notebooks to test the list operation with
|
||||
creates := []*influxdb.NotebookReqBody{
|
||||
|
|
Loading…
Reference in New Issue