fix login

This commit is contained in:
mfnefd 2024-06-19 22:30:34 +04:00
parent e109746059
commit 4d8c2c8a15

View File

@ -1,4 +1,5 @@
using BusinessLogic.BusinessLogic; using BusinessLogic.BusinessLogic;
using BusinessLogic.Tools.Mail.MailTemplates;
using Contracts.BindingModels; using Contracts.BindingModels;
using Contracts.BusinessLogicContracts; using Contracts.BusinessLogicContracts;
using Contracts.Exceptions; using Contracts.Exceptions;
@ -21,11 +22,11 @@ namespace RestAPI.Controllers
} }
[HttpPost] [HttpPost]
public IResult Login(string email, string password) public IResult Login([FromBody] UserData data)
{ {
try try
{ {
var res = _userLogic.Login(email, password); var res = _userLogic.Login(data.email, data.password);
return Results.Ok(res); return Results.Ok(res);
} }
catch (ElementNotFoundException ex) catch (ElementNotFoundException ex)
@ -125,4 +126,6 @@ namespace RestAPI.Controllers
} }
} }
} }
public record class UserData(string email, string password);
} }