Exemplo n.º 1
0
        public async Task <IActionResult> UpdatePlaylist(int id, [FromBody] PlaylistViewModel model)
        {
            var playlist = await _playlistService.Update(id, model.ToDTO());

            var playlistViewModel = playlist.ToViewModel();

            return(Ok(playlistViewModel));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreatePlaylist(PlaylistViewModel model)
        {
            var playlist = await _playlistService.Create(model.ToDTO());

            var playlistViewModel = playlist.ToDTO().ToViewModel();

            return(Created("post", playlistViewModel));
        }