瀏覽代碼

feat(playlist): render playlists if playlist id is invalid

close #4209
bergquist 9 年之前
父節點
當前提交
00dc078311
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 5 0
      pkg/api/playlist.go
  2. 3 0
      public/app/features/playlist/playlist_routes.js

+ 5 - 0
pkg/api/playlist.go

@@ -17,6 +17,11 @@ func ValidateOrgPlaylist(c *middleware.Context) {
 		return
 	}
 
+	if query.Result.OrgId == 0 {
+		c.JsonApiErr(404, "Playlist not found", err)
+		return
+	}
+
 	if query.Result.OrgId != c.OrgId {
 		c.JsonApiErr(403, "You are not allowed to edit/view playlist", nil)
 		return

+ 3 - 0
public/app/features/playlist/playlist_routes.js

@@ -26,6 +26,9 @@ function (angular) {
         controller : 'PlaylistEditCtrl'
       })
       .when('/playlists/play/:id', {
+        templateUrl: 'public/app/features/playlist/partials/playlists.html',
+        controllerAs: 'ctrl',
+        controller : 'PlaylistsCtrl',
         resolve: {
           init: function(playlistSrv, $route) {
             var playlistId = $route.current.params.id;