mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 07:35:45 -06:00
make create call consistent with update and delete
This commit is contained in:
parent
3b53fdb53a
commit
26b6463bd6
@ -168,11 +168,15 @@ func (pd *PublicDashboardServiceImpl) Create(ctx context.Context, u *user.Signed
|
||||
},
|
||||
}
|
||||
|
||||
_, err = pd.store.Create(ctx, cmd)
|
||||
affectedRows, err := pd.store.Create(ctx, cmd)
|
||||
if err != nil {
|
||||
return nil, ErrInternalServerError.Errorf("Create: failed to create the public dashboard: %w", err)
|
||||
}
|
||||
|
||||
if affectedRows == 0 {
|
||||
return nil, ErrPublicDashboardNotFound.Errorf("Create: failed to create a public dashboard with Uid: %s", uid)
|
||||
}
|
||||
|
||||
//Get latest public dashboard to return
|
||||
newPubdash, err := pd.store.Find(ctx, uid)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user