This commit is contained in:
2023-12-16 21:18:01 +02:00
parent 775146ee86
commit 2feaf50802
46 changed files with 641 additions and 429 deletions
+2 -7
View File
@@ -14,9 +14,9 @@ using Core;
using Services.Users;
using Services.Users.Domain;
using MyOffice.Data.Models.Currencies;
using MyOffice.Web.Infrastructure.Attributes;
[ApiController]
[Route("api/[controller]")]
[DefaultFromBody]
public class UserController : BaseApiController
{
private readonly UserManager<ApplicationUser<Guid>> _userManager;
@@ -34,7 +34,6 @@ public class UserController : BaseApiController
_externalProviderValidators = externalProviderValidators;
}
[HttpPost("~/api/user/register")]
public async Task<object> Register([FromBody] RegisterModel request)
{
var user = new ApplicationUser<Guid>
@@ -55,7 +54,6 @@ public class UserController : BaseApiController
}
[Authorize]
[HttpGet("~/api/user/profile")]
public async Task<object> ProfileGet()
{
var user = await _userManager.GetUserAsync(User);
@@ -64,7 +62,6 @@ public class UserController : BaseApiController
}
[Authorize]
[HttpPost("~/api/user/profile")]
public async Task<object> ProfileUpdate([FromBody] ProfileModel model)
{
var user = await _userManager.GetUserAsync(User);
@@ -80,7 +77,6 @@ public class UserController : BaseApiController
}
[Authorize]
[HttpPost("~/api/user/attach")]
public async Task<object> AttachProvider([FromBody] AttachModel model)
{
var validator = _externalProviderValidators.FirstOrDefault(x => x.Provider.EqualsIgnoreCase(model.Provider));
@@ -108,7 +104,6 @@ public class UserController : BaseApiController
}
[Authorize]
[HttpPost("~/api/user/deattach")]
public async Task<object> DeattachProvider([FromBody] DeattachModel model)
{
var exec = await _userService.RemoveUserExternal(UserId, model.Provider);