From e1c0355b37434542f40b39341602d7346d17d2a4 Mon Sep 17 00:00:00 2001 From: Petar Date: Sun, 25 Jun 2023 19:49:51 +0200 Subject: [PATCH] fix the wrong called method for houlry forecast, remove unneccessary code that was commented out --- WeatherAppBackend/Program.cs | 20 ------------------- .../Service/Impl/WeatherService.cs | 2 +- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/WeatherAppBackend/Program.cs b/WeatherAppBackend/Program.cs index 708f58f..f5368c4 100644 --- a/WeatherAppBackend/Program.cs +++ b/WeatherAppBackend/Program.cs @@ -41,23 +41,6 @@ BearerFormat = "JWT", Scheme = "Bearer" }); - //options.AddSecurityRequirement(new OpenApiSecurityRequirement - //{ - // { - // new OpenApiSecurityScheme - // { - // Reference = new OpenApiReference - // { - // Type = ReferenceType.SecurityScheme, - // Id = "Bearer" - // }, - // Scheme = "oauth2", - // Name = "Bearer", - // In = ParameterLocation.Header - // }, - // new List() - // } - //}); options.OperationFilter(); }); builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) @@ -95,11 +78,8 @@ dataContext.Database.Migrate(); } -//if (app.Environment.IsDevelopment()) -//{ app.UseSwagger(); app.UseSwaggerUI(); -//} app.UseCors(corsPolicyName); diff --git a/WeatherAppBackend/Service/Impl/WeatherService.cs b/WeatherAppBackend/Service/Impl/WeatherService.cs index 50bdcee..72ea95f 100644 --- a/WeatherAppBackend/Service/Impl/WeatherService.cs +++ b/WeatherAppBackend/Service/Impl/WeatherService.cs @@ -29,7 +29,7 @@ private string GetUrlForOtherIntervals(string forecastType, string city) { var str when str.Equals(ForecastCategoryType.TwoDay.GetType(), StringComparison.OrdinalIgnoreCase) => ConstructUrlForMultipleDayForecast(city, ForecastCategoryType.TwoDay.GetInterval()), var str when str.Equals(ForecastCategoryType.SevenDay.GetType(), StringComparison.OrdinalIgnoreCase) => ConstructUrlForMultipleDayForecast(city, ForecastCategoryType.SevenDay.GetInterval()), - var str when str.Equals(ForecastCategoryType.OneHour.GetType(), StringComparison.OrdinalIgnoreCase) => ConstructUrlForMultipleDayForecast(city, ForecastCategoryType.SevenDay.GetInterval()), + var str when str.Equals(ForecastCategoryType.OneHour.GetType(), StringComparison.OrdinalIgnoreCase) => ConstructUrlForOneHourForecast(city), _ => GetCurrentWeatherUrl(city), }; return finalConstructedUrl;