public async Task <IActionResult> Search(string phrase)
        {
            if (string.IsNullOrEmpty(phrase))
            {
                return(RedirectToAction(nameof(Index)));
            }

            var matchingOffers = await _jobOfferService.GetOffersContainingPhrase(phrase);

            var vms = _mapper.Map <IList <JobOfferViewModel> >(matchingOffers);

            ViewData["JobOfferCount"] = vms.Count;
            ViewData["phrase"]        = phrase;

            if (!await _authService.IsSignedIn(HttpContext.User))
            {
                return(View("Index", vms));
            }

            var user = await _authService.GetSignedUser(User);

            foreach (var offer in vms)
            {
                offer.CanEdit = await _jobOfferService.CanUserEditOffer(user.Id, offer.JobOfferId);
            }
            return(View("Index", vms));
        }