コード例 #1
0
        public IActionResult ActivateOffer(Guid id)
        {
            if (!_offerService.CheckIfOfferExists(id))
            {
                return(NotFound());
            }
            var offer = _offerService.ActivateOffer(id);

            return(Ok(offer));
        }
コード例 #2
0
        public async Task <IActionResult> Activate(string id)
        {
            _offerService.ActivateOffer(id);
            var offer = await _offerService.GetOfferAsync(id);

            var activatedOfferDto = _mapper.Map <OfferDto>(offer);

            activatedOfferDto.Images = CreateUrlsToPhotos(offer.Images);
            return(Ok(activatedOfferDto));
        }
コード例 #3
0
        public ActionResult ActivateOffer(string id)
        {
            _offer.ActivateOffer(id);

            return(RedirectToAction("Campaign"));
        }