Ejemplo n.º 1
0
        public async Task <PageDetailsDto> SavePageContentAsync(PageDetailsDto pageDetailsDto)
        {
            var item = await Context.Pages.Include(e => e.PageAreas).FirstOrDefaultAsync(e => e.Id == pageDetailsDto.Id);

            Mapper.Map(pageDetailsDto, item);
            await Context.SaveChangesAsync();

            return(Mapper.Map <PageDetailsDto>(item));
        }
Ejemplo n.º 2
0
 public async Task <ActionResult <PageDetailsDto> > SavePageContent(PageDetailsDto pageDetailsDto)
 {
     try
     {
         var userEmail = GetUserEmail();
         if (!await _securityService.HasUserAccessToSite(pageDetailsDto.SiteId, userEmail))
         {
             return(Forbid());
         }
         return(Ok(await _pageService.SavePageContentAsync(pageDetailsDto)));
     }
     catch (Exception ex)
     {
         return(BadRequest(new { message = $"Error occurred attempting to save page content: {ex.InnerException?.Message ?? ex.Message}" }));
     }
 }
Ejemplo n.º 3
0
 public async Task <PageDetailsDto> SavePageContentAsync(PageDetailsDto pageDetailsDto)
 {
     return(await _pageDao.SavePageContentAsync(pageDetailsDto));
 }