LBAC for datasources: Refactor to only use jsondata and not the datasource struct (#98294)

refactor to only use jsondata and not the datasource struct
This commit is contained in:
Eric Leijonmarck
2024-12-20 11:40:26 +00:00
committed by GitHub
parent 58d17ecad1
commit e0e4e1cdff
2 changed files with 1 additions and 5 deletions
-4
View File
@@ -88,10 +88,6 @@ type TeamHTTPHeader struct {
Value string `json:"value"`
}
func (ds DataSource) TeamHTTPHeaders() (*TeamHTTPHeaders, error) {
return GetTeamHTTPHeaders(ds.JsonData)
}
func GetTeamHTTPHeaders(jsonData *simplejson.Json) (*TeamHTTPHeaders, error) {
teamHTTPHeaders := &TeamHTTPHeaders{}
if jsonData == nil {
+1 -1
View File
@@ -95,7 +95,7 @@ func TestTeamHTTPHeaders(t *testing.T) {
UID: "test",
}
actual, err := ds.TeamHTTPHeaders()
actual, err := GetTeamHTTPHeaders(ds.JsonData)
assert.NoError(t, err)
assert.Equal(t, test.want, actual)
assert.EqualValues(t, test.want, actual)