API: Fix snapshot responses (#52998) (#53244)

* API: Fix response status when snapshots are not found

* API: Fix response status when snapshot key is empty

* Apply suggestions from code review

(cherry picked from commit 5fec6cc4f5)

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-08-04 12:12:34 +03:00
committed by GitHub
co-authored by Sofia Papagiannaki
parent 17de328ac8
commit b308c331c2
6 changed files with 117 additions and 10 deletions
@@ -91,7 +91,7 @@ func (d *DashboardSnapshotStore) GetDashboardSnapshot(ctx context.Context, query
if err != nil {
return err
} else if !has {
return dashboardsnapshots.ErrDashboardSnapshotNotFound
return dashboardsnapshots.ErrBaseNotFound.Errorf("dashboard snapshot not found")
}
query.Result = &snapshot