publicdashboards: split create/update api paths (#57940)

This PR splits the create and update paths for public dashboards and includes assorted refactors toward a proper REST API. Additionally, we removed the concept of a "public dashboard config" in favor of "public dashboard" 

Co-authored-by: juanicabanas <juan.cabanas@grafana.com>
Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
This commit is contained in:
Jeff Levin
2022-11-03 11:30:12 -08:00
committed by GitHub
co-authored by juanicabanas Ezequiel Victorero
parent 0367f61bb3
commit 6fcc5b42c0
24 changed files with 996 additions and 612 deletions
@@ -257,7 +257,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
AccessToken: "an-access-token",
},
}
err := publicDashboardStore.Save(context.Background(), cmd)
_, err := publicDashboardStore.Create(context.Background(), cmd)
require.NoError(t, err)
pubdashConfig, _ := publicDashboardStore.FindByAccessToken(context.Background(), "an-access-token")
require.NotNil(t, pubdashConfig)
@@ -292,7 +292,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
AccessToken: "an-access-token",
},
}
err := publicDashboardStore.Save(context.Background(), cmd)
_, err := publicDashboardStore.Create(context.Background(), cmd)
require.NoError(t, err)
pubdashConfig, _ := publicDashboardStore.FindByAccessToken(context.Background(), "an-access-token")
require.NotNil(t, pubdashConfig)