Include library elements on counts endpoint (#98246)

This commit is contained in:
Leonor Oliveira 2024-12-19 12:38:08 +01:00 committed by GitHub
parent 989ee681f8
commit c1e078b3a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 0 deletions

View File

@ -63,6 +63,12 @@ func (s *LegacyStatsGetter) GetStats(ctx context.Context, in *resource.ResourceS
if err != nil {
return err
}
// Legacy library_elements table
err = fn("library_element", "org_id=? AND folder_uid=?", group, "library_elements")
if err != nil {
return err
}
return nil
})

View File

@ -133,6 +133,10 @@ func TestDirectSQLStats(t *testing.T) {
"group": "sql-fallback",
"resource": "folders",
"count": 1
},
{
"group": "sql-fallback",
"resource": "library_elements"
}
]`, string(jj))
})
@ -161,6 +165,10 @@ func TestDirectSQLStats(t *testing.T) {
{
"group": "sql-fallback",
"resource": "folders"
},
{
"group": "sql-fallback",
"resource": "library_elements"
}
]`, string(jj))
})