Exemple #1
0
        public IActionResult Edit(AdvertEditViewModel advertViewModel)
        {
            if (ModelState.IsValid)
            {
                advertRepository.EditAdvert(advertViewModel);

                flashMessage.Confirmation("Ogłoszenie zostało zedytowane");
                return(RedirectToAction(nameof(AdvertController.Details), nameof(AdvertController).Replace("Controller", ""), new { advertId = advertViewModel.AdvertId }));
            }
            else
            {
                return(View(advertViewModel));
            }
        }