From d03df908847b76193ac8f06e0617c037b122478a Mon Sep 17 00:00:00 2001 From: Corentin R <76619184+Koroh63@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:17:34 +0100 Subject: [PATCH] Ajout put & delete --- Sources/API_LoL/Controllers/ChampionsController.cs | 1 + Sources/API_LoL/Mapper/ChampionMapper.cs | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Sources/API_LoL/Controllers/ChampionsController.cs b/Sources/API_LoL/Controllers/ChampionsController.cs index e89d098..0e4df63 100644 --- a/Sources/API_LoL/Controllers/ChampionsController.cs +++ b/Sources/API_LoL/Controllers/ChampionsController.cs @@ -133,6 +133,7 @@ namespace API_LoL.Controllers { await ChampionsManager.AddItem(champion.ToChampion()); return CreatedAtAction("Post",champion); + } } diff --git a/Sources/API_LoL/Mapper/ChampionMapper.cs b/Sources/API_LoL/Mapper/ChampionMapper.cs index 728bc29..632149e 100644 --- a/Sources/API_LoL/Mapper/ChampionMapper.cs +++ b/Sources/API_LoL/Mapper/ChampionMapper.cs @@ -12,19 +12,13 @@ namespace DTO.Mapper { public static ChampionDTO ToDTO(this Champion champion) { - return new ChampionDTO(champion.Name, champion.Bio, champion.Icon, champion.Class.ToDTO().ToString(), champion.Image.Base64); - //return new ChampionDTO(champion.Name, champion.Bio, champion.Icon, champion.Skills); + return new ChampionDTO(champion.Name, champion.Bio, champion.Icon, champion.Class.ToDTO(), champion.Image.Base64); } public static Champion ToChampion(this ChampionDTO champion) { - Champion champ = new Champion(champion.Name, champClass: champion.Class.ToChampionClass(),icon: champion.Icon,bio: champion.Bio,image :champion.Image); + return new Champion(champion.Name, champClass: champion.Class.ToChampionClass(),icon: champion.Icon,bio: champion.Bio,image :champion.Image); - //foreach (Skill skill in champion.Skills) - //{ - // champ.AddSkill(skill); - //} - return champ; } } }