Added add user call
This commit is contained in:
parent
d3f93dbaaf
commit
da6d063358
|
@ -44,22 +44,13 @@ namespace Weiferl.Api.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("addUser")]
|
[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
|
try
|
||||||
{
|
{
|
||||||
|
user.UserId = Guid.NewGuid();
|
||||||
|
user.RegisterDate = DateTime.Now;
|
||||||
|
user.IsDeleted = false;
|
||||||
await userRepo.CreateUser(user);
|
await userRepo.CreateUser(user);
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
@ -68,6 +59,7 @@ namespace Weiferl.Api.Controllers
|
||||||
return BadRequest(ex);
|
return BadRequest(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPost("updateUser")]
|
[HttpPost("updateUser")]
|
||||||
public async Task<IActionResult> UpdateUser()
|
public async Task<IActionResult> UpdateUser()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user