Address post is broken

This commit is contained in:
Victor Turgeon
2022-11-08 05:37:12 -05:00
parent 4992e4fc3f
commit faa119b0ad
5 changed files with 159 additions and 42 deletions

View File

@@ -62,7 +62,7 @@ public class AddressController : Controller {
id = _signInMan.Context.User.Identity.GetUserId();
if (all is not null && all == true && roles.Contains("Administrateur"))
return Ok(_context.Addresses.ToList());
else return Ok(user.Adresses.ToList());
else return Ok(_context.Users.Where(x=>x.Id == id).Include("Adresses").First().Adresses);
} catch (Exception e) {
_logger.LogError(10, e.Message);
return BadRequest();

View File

@@ -386,6 +386,7 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
LastName = "Admin",
NormalizedUserName = "ADMIN",
UserName = "Admin",
PhoneNumber = "111-111-1111",
Id = AdminID,
NormalizedEmail = "ADMIN@ADMIN.COM",
Email = "admin@admin.com"
@@ -396,6 +397,7 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
LastName = "A.",
NormalizedUserName = "PASLA",
UserName = "PasLa",
PhoneNumber="222-222-2222",
Id = PaulID,
NormalizedEmail = "PAUL@EXEMPLE.COM",
Email = "paul@exemple.com"