diff --git a/CityInfo.API/Controllers/PointsOfInterestController.cs b/CityInfo.API/Controllers/PointsOfInterestController.cs index 00672fa..97de9f1 100644 --- a/CityInfo.API/Controllers/PointsOfInterestController.cs +++ b/CityInfo.API/Controllers/PointsOfInterestController.cs @@ -36,11 +36,11 @@ namespace CityInfo.API.Controllers try { //throw new Exception("caca prout"); - var cityName = User.Claims.FirstOrDefault(claim => claim.Type == "city")?.Value; - if (!await _cityInfoRepository.CityNameMatchesCityId(cityName, cityId)) - { - return Forbid(); - } + //var cityName = User.Claims.FirstOrDefault(claim => claim.Type == "city")?.Value; + //if (!await _cityInfoRepository.CityNameMatchesCityId(cityName, cityId)) + //{ + // return Forbid(); + //} if(!await _cityInfoRepository.CityExistAsync(cityId)) { diff --git a/CityInfo.WEB/Components/Loading.razor b/CityInfo.WEB/Components/Loading.razor new file mode 100644 index 0000000..1281447 --- /dev/null +++ b/CityInfo.WEB/Components/Loading.razor @@ -0,0 +1,8 @@ +
+
+
Chargement...
+
+
+
+
+
diff --git a/CityInfo.WEB/Components/PageHeader.razor b/CityInfo.WEB/Components/PageHeader.razor index ac8839c..7507e77 100644 --- a/CityInfo.WEB/Components/PageHeader.razor +++ b/CityInfo.WEB/Components/PageHeader.razor @@ -5,14 +5,28 @@
@NameType

@Name

-
-
- - - Ajouter - + @if(Link != null) + { +
+
+ @if(LinkType == LinkType.Create) + { + + + Ajouter + + } else if(LinkType == LinkType.Edit) + { + + + Editer + + } + +
-
+ } +
\ No newline at end of file diff --git a/CityInfo.WEB/Components/PageHeader.razor.cs b/CityInfo.WEB/Components/PageHeader.razor.cs index 1363e57..7a36ae3 100644 --- a/CityInfo.WEB/Components/PageHeader.razor.cs +++ b/CityInfo.WEB/Components/PageHeader.razor.cs @@ -2,6 +2,11 @@ namespace CityInfo.WEB.Components { + public enum LinkType + { + Create, + Edit + } public partial class PageHeader { [Parameter] @@ -9,6 +14,8 @@ namespace CityInfo.WEB.Components [Parameter] public string NameType { get; set; } = string.Empty; [Parameter] - public string Link { get; set; } = string.Empty; + public string? Link { get; set; } + [Parameter] + public LinkType LinkType { get; set; } = LinkType.Create; } } diff --git a/CityInfo.WEB/Layout/NavMenu.razor b/CityInfo.WEB/Layout/NavMenu.razor index ce2e637..33d345b 100644 --- a/CityInfo.WEB/Layout/NavMenu.razor +++ b/CityInfo.WEB/Layout/NavMenu.razor @@ -21,7 +21,7 @@ Accueil - +