Пример #1
0
        public async Task <ActionResult> AddSongToPlaylistAsync(int sID, int plID)
        {
            int accountId = JWTUtility.GetIdFromRequestHeaders(Request.Headers);

            if (accountId == -1)
            {
                return(BadRequest());
            }

            if (!await _songService.CanModifyAsync(accountId, sID, plID))
            {
                return(Unauthorized());
            }

            await _songService.AddSongToPlaylistAsync(sID, plID);

            return(Ok());
        }