public async Task <AdminUserResponseModel> GetByEmailAsync([FromBody] GetByEmailRequestModel request) { if (string.IsNullOrWhiteSpace(request?.Email)) { throw new BadRequestException($"{nameof(request.Email)} can't be empty"); } var admin = await _adminUserService.GetByEmailAsync(request.Email, request.Active); return(_mapper.Map <AdminUserResponseModel>(admin)); }
public async Task <CustomerProfileResponse> GetByEmailAsync([FromBody] GetByEmailRequestModel model) { if (string.IsNullOrWhiteSpace(model.Email)) { throw new BadRequestException($"{nameof(model.Email)} can't be empty"); } var result = await _customerProfileService.GetByEmailAsync(model.Email, model.IncludeNotVerified, model.IncludeNotActive); if (!string.IsNullOrEmpty(result?.Profile?.CustomerId)) { _log.Info(GetApiKeyName(), new { customerId = result.Profile.CustomerId }); } return(_mapper.Map <CustomerProfileResponse>(result)); }