Esempio n. 1
0
        public async Task <IActionResult> SearchSpotify(string query, SpotifyQueryType?queryType)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(query))
                {
                    return(StatusCode(200));
                }

                return(new JsonResult(await _partyGoerService.SearchSpotifyAsync(query, queryType ?? SpotifyQueryType.All)));
            }
            catch (Exception ex)
            {
                await _logService.LogExceptionAsync(ex, $"Error occured while trying to query Spotify. Search query: {query} queryType: {queryType}");

                return(StatusCode(500));
            }
        }