diff --git a/pkg/api/playlist.go b/pkg/api/playlist.go index 72181772e52..cfe9956987a 100644 --- a/pkg/api/playlist.go +++ b/pkg/api/playlist.go @@ -1,8 +1,6 @@ package api import ( - "net/http" - "github.com/grafana/grafana/pkg/bus" "github.com/grafana/grafana/pkg/models" ) @@ -26,18 +24,6 @@ func ValidateOrgPlaylist(c *models.ReqContext) { c.JsonApiErr(403, "You are not allowed to edit/view playlist", nil) return } - - items, itemsErr := LoadPlaylistItemDTOs(id) - - if itemsErr != nil { - c.JsonApiErr(404, "Playlist items not found", err) - return - } - - if len(items) == 0 && c.Context.Req.Method != http.MethodDelete { - c.JsonApiErr(404, "Playlist is empty", itemsErr) - return - } } func SearchPlaylists(c *models.ReqContext) Response { diff --git a/public/app/features/playlist/playlist_edit_ctrl.ts b/public/app/features/playlist/playlist_edit_ctrl.ts index e7fd1f42317..e93bc4568f6 100644 --- a/public/app/features/playlist/playlist_edit_ctrl.ts +++ b/public/app/features/playlist/playlist_edit_ctrl.ts @@ -46,14 +46,7 @@ export class PlaylistEditCtrl { .get('/api/playlists/' + playlistId) .then((result: any) => { this.playlist = result; - }) - ); - - promiseToDigest(this.$scope)( - getBackendSrv() - .get('/api/playlists/' + playlistId + '/items') - .then((result: any) => { - this.playlistItems = result; + this.playlistItems = result.items; }) ); }