feat(nested folders): Add CountAlertRulesInFolder to ngalert store (#58269)
* chore: refactor CountDashboardsInFolder to use the more efficient Count() sql function * feat(nested folders): Add CountAlertRulesInFolder to ngalert store This commit adds CountAlertRulesInFolder and a new model for the CountAlertRulesQuery. It returns a count of alert rules associated with a given orgID and parent folder UID. (the namespace referenced inside alert rules is the parent folder). I'm not sure where this belongs in the ngalert service, so that will come in a future commit.
This commit is contained in:
@@ -32,12 +32,12 @@ type DashboardSearchProjection struct {
|
||||
|
||||
type CountDashboardsInFolderQuery struct {
|
||||
FolderUID string
|
||||
OrgID int64
|
||||
}
|
||||
|
||||
// Note for reviewers: I wasn't sure what to name this. It's not actually a DTO
|
||||
// CountDashboardsInFolderRequest is the request passed from the service to the
|
||||
// store layer. The FolderID will be replaced with FolderUID when dashboards are
|
||||
// updated with parent folder UIDs.
|
||||
// TODO: CountDashboardsInFolderRequest is the request passed from the service
|
||||
// to the store layer. The FolderID will be replaced with FolderUID when
|
||||
// dashboards are updated with parent folder UIDs.
|
||||
type CountDashboardsInFolderRequest struct {
|
||||
FolderID int64
|
||||
OrgID int64
|
||||
|
||||
Reference in New Issue
Block a user