public async Task <IActionResult> Create([FromBody] CreateResetPasswordTokenRequest request)
        {
            try
            {
                ResetPasswordAccessToken token =
                    await _accessTokenService.CreateAsync(request.EmployeeId, request.MerchantId);

                return(Ok(Mapper.Map <ResetPasswordAccessTokenResponse>(token)));
            }
            catch (DuplicateKeyException e)
            {
                _log.Error(e, $"{e.Message}, request: {request.ToJson()}");

                return(BadRequest(ErrorResponse.Create(e.Message)));
            }
        }
Beispiel #2
0
 public Task <ResetPasswordTokenModel> CreateResetPasswordTokenAsync(CreateResetPasswordTokenRequest request)
 {
     return(_runner.RunAsync(() => _resetPasswordApi.CreateAsync(request)));
 }