Exemplo n.º 1
0
        public IActionResult DeleteCoverPhoto(int playlistId)
        {
            int userId = int.Parse(HttpContext.User.Claims.FirstOrDefault(c => c.Type == claimTypes.Id.ToString()).Value);

            if (!db.CheckPlaylistExists(playlistId, userId))
            {
                return(StatusCode(403, new ErrorDetails()
                {
                    errorId = ErrorList.UnauthorizedAction.Id, errorMessage = ErrorList.UnauthorizedAction.Description
                }.ToString()));
            }

            var result = db.DeletePlaylistCover(playlistId, userId);

            return(Ok(new { response = result }));
        }