PublicDashboards: do not return errors when resource not found from store layer (#57838)

This commit is contained in:
Ezequiel Victorero
2022-10-31 11:22:27 -03:00
committed by GitHub
parent f0ab4bea8c
commit 46093c1267
8 changed files with 147 additions and 61 deletions

View File

@@ -152,13 +152,13 @@ func (_m *FakePublicDashboardStore) FindByDashboardUid(ctx context.Context, orgI
return r0, r1
}
// FindDashboard provides a mock function with given fields: ctx, dashboardUid, orgId
func (_m *FakePublicDashboardStore) FindDashboard(ctx context.Context, dashboardUid string, orgId int64) (*pkgmodels.Dashboard, error) {
ret := _m.Called(ctx, dashboardUid, orgId)
// FindDashboard provides a mock function with given fields: ctx, orgId, dashboardUid
func (_m *FakePublicDashboardStore) FindDashboard(ctx context.Context, orgId int64, dashboardUid string) (*pkgmodels.Dashboard, error) {
ret := _m.Called(ctx, orgId, dashboardUid)
var r0 *pkgmodels.Dashboard
if rf, ok := ret.Get(0).(func(context.Context, string, int64) *pkgmodels.Dashboard); ok {
r0 = rf(ctx, dashboardUid, orgId)
if rf, ok := ret.Get(0).(func(context.Context, int64, string) *pkgmodels.Dashboard); ok {
r0 = rf(ctx, orgId, dashboardUid)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*pkgmodels.Dashboard)
@@ -166,8 +166,8 @@ func (_m *FakePublicDashboardStore) FindDashboard(ctx context.Context, dashboard
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string, int64) error); ok {
r1 = rf(ctx, dashboardUid, orgId)
if rf, ok := ret.Get(1).(func(context.Context, int64, string) error); ok {
r1 = rf(ctx, orgId, dashboardUid)
} else {
r1 = ret.Error(1)
}