public IActionResult MissingPhoneNumber(string offerId) { var model = new MissingOfferInputModel { OfferId = offerId, }; return this.View(model); }
public async Task<IActionResult> MissingPhoneNumber(MissingOfferInputModel model) { // ADD phoneNumber validation (regex) and implement the view if (!this.ModelState.IsValid) { return this.View(model); } try { var currentUser = await this.userManager.GetUserAsync(this.User); await this.usersService.UpdateUserPhoneNumberAsync(currentUser.Id, model.UserPhoneNumber); return this.RedirectToAction(nameof(this.Accept), new { model.OfferId }); } catch (Exception) { return this.CustomNotFound(); } }