public async Task <IActionResult> RegisterMechanic([FromBody] RegisterMechanicCredentials registerMechanicCredentials) { if (!ModelState.IsValid) { return(BadRequest()); } var result = await _accountService.RegisterMechanic(registerMechanicCredentials); if (!result.Succeeded) { return(BadRequest(result.Errors)); } return(Ok()); }
public async Task <IdentityResult> RegisterMechanic(RegisterMechanicCredentials registerMechanicCredentials) { var mechanic = _iMapper.Map <RegisterMechanicCredentials, Mechanic>(registerMechanicCredentials); return(await AddUser(mechanic, registerMechanicCredentials.Password)); }