Chore: Deprecate FolderID from CountDashboardsInFolderRequest (#77804)
Deprecate FolderID from CountDashboardsInFolderRequest
This commit is contained in:
@@ -1068,6 +1068,7 @@ func (d *dashboardStore) CountDashboardsInFolder(
|
||||
var count int64
|
||||
var err error
|
||||
err = d.store.WithDbSession(ctx, func(sess *db.Session) error {
|
||||
// nolint:staticcheck
|
||||
session := sess.In("folder_id", req.FolderID).In("org_id", req.OrgID).
|
||||
In("is_folder", d.store.GetDialect().BooleanStr(false))
|
||||
count, err = session.Count(&dashboards.Dashboard{})
|
||||
|
||||
@@ -517,12 +517,14 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
// setup() saves one dashboard in the general folder and two in the "savedFolder".
|
||||
count, err := dashboardStore.CountDashboardsInFolder(
|
||||
context.Background(),
|
||||
// nolint:staticcheck
|
||||
&dashboards.CountDashboardsInFolderRequest{FolderID: 0, OrgID: 1})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(1), count)
|
||||
|
||||
count, err = dashboardStore.CountDashboardsInFolder(
|
||||
context.Background(),
|
||||
// nolint:staticcheck
|
||||
&dashboards.CountDashboardsInFolderRequest{FolderID: savedFolder.ID, OrgID: 1})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(2), count)
|
||||
@@ -542,6 +544,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
||||
// nolint:staticcheck
|
||||
count, err := dashboardStore.CountDashboardsInFolder(context.Background(), &dashboards.CountDashboardsInFolderRequest{FolderID: 2, OrgID: 1})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, count, int64(0))
|
||||
|
||||
Reference in New Issue
Block a user