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)); }
public async Task <IActionResult> CreatePlaylist(PlaylistViewModel model) { var playlist = await _playlistService.Create(model.ToDTO()); var playlistViewModel = playlist.ToDTO().ToViewModel(); return(Created("post", playlistViewModel)); }