Added add user call

This commit is contained in:
Marcus Ferl 2023-07-09 22:24:11 +02:00
parent d3f93dbaaf
commit da6d063358

View File

@ -44,22 +44,13 @@ namespace Weiferl.Api.Controllers
}
[HttpPost("addUser")]
public async Task<IActionResult> AddUser()
public async Task<IActionResult> AddUser([FromBody] User user)
{
var user = new User
{
UserId = Guid.NewGuid(),
Firstname = "Marcus",
Lastname = "Ferl",
Birthday = new DateTime(1986, 01, 17),
Email = "marcus@weifer.de",
IsDeleted = false,
RegisterDate = DateTime.Now,
CountrySlug = "DE"
};
try
{
user.UserId = Guid.NewGuid();
user.RegisterDate = DateTime.Now;
user.IsDeleted = false;
await userRepo.CreateUser(user);
return Ok();
}
@ -68,6 +59,7 @@ namespace Weiferl.Api.Controllers
return BadRequest(ex);
}
}
[HttpPost("updateUser")]
public async Task<IActionResult> UpdateUser()
{