mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 09:21:47 +08:00
Fix importing plugin dashboards (#21501)
#21350 introduced a bug regarding import of plugin dashboards. This should fix this and add custom validation if not importing plugin dashboard and dashboard property is missing. Ref #21350 Co-Authored-By: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:

committed by
GitHub

parent
98bbdea69d
commit
54c9b11ae8
@ -179,6 +179,10 @@ func GetPluginMarkdown(c *m.ReqContext) Response {
|
||||
}
|
||||
|
||||
func ImportDashboard(c *m.ReqContext, apiCmd dtos.ImportDashboardCommand) Response {
|
||||
if apiCmd.PluginId == "" && apiCmd.Dashboard == nil {
|
||||
return Error(422, "Dashboard must be set", nil)
|
||||
}
|
||||
|
||||
cmd := plugins.ImportDashboardCommand{
|
||||
OrgId: c.OrgId,
|
||||
User: c.SignedInUser,
|
||||
|
Reference in New Issue
Block a user