Shifts Book - modified return View () to point to Index not /Index, added Map keys in the view data

This commit is contained in:
Bianca Corsatea 2020-05-04 18:38:09 +01:00
Родитель 3fe0a35093
Коммит 482a140023
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -252,7 +252,9 @@ namespace Project.Zap.Controllers
this.logger.LogInformation("No locations, so redirecting to location view");
return Redirect("/Locations");
}
return View("/Index", await this.GetShifts(locations));
ViewData["AzureMapsKey"] = this.configuration["AzureMapsSubscriptionKey"];
return View("Index", await this.GetShifts(locations));
}
Location location = await this.GetLocation(viewModel.LocationName);
@ -278,7 +280,9 @@ namespace Project.Zap.Controllers
this.logger.LogInformation("No locations, so redirecting to location view");
return Redirect("/Locations");
}
return View("/Index", await this.GetShifts(locations));
ViewData["AzureMapsKey"] = this.configuration["AzureMapsSubscriptionKey"];
return View("Index", await this.GetShifts(locations));
}
shift.EmployeeId = id.Value;

Просмотреть файл

@ -19,7 +19,7 @@
@if (ViewData.ContainsKey("ValidationError"))
{
<div class="alert alert-danger">
<strong>@ViewData["ValidationError"]</strong> @ViewData["ValidationError"]
<strong>@ViewData["ValidationError"]</strong>
</div>
}