From da6d063358f5dd1c9bf0c2e2c2b31819e3445847 Mon Sep 17 00:00:00 2001 From: Marcus Ferl Date: Sun, 9 Jul 2023 22:24:11 +0200 Subject: [PATCH] Added add user call --- Weiferl.Api/Controllers/Users.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Weiferl.Api/Controllers/Users.cs b/Weiferl.Api/Controllers/Users.cs index d69bd3d..0295785 100644 --- a/Weiferl.Api/Controllers/Users.cs +++ b/Weiferl.Api/Controllers/Users.cs @@ -44,22 +44,13 @@ namespace Weiferl.Api.Controllers } [HttpPost("addUser")] - public async Task AddUser() + public async Task 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 UpdateUser() {