Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions WeatherAppBackend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>()
// }
//});
options.OperationFilter<SecurityRequirementsOperationFilter>();
});
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
Expand Down Expand Up @@ -95,11 +78,8 @@
dataContext.Database.Migrate();
}

//if (app.Environment.IsDevelopment())
//{
app.UseSwagger();
app.UseSwaggerUI();
//}

app.UseCors(corsPolicyName);

Expand Down
2 changes: 1 addition & 1 deletion WeatherAppBackend/Service/Impl/WeatherService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down