Exemple #1
0
        public async Task <IActionResult> Segment()
        {
            var pageSegments = await _blogPageService.ListSegmentAsync();

            if (pageSegments is null)
            {
                return(Ok(Array.Empty <PageSegment>()));
            }

            // for security, only allow published pages to be listed to third party API calls
            var published = pageSegments.Where(p => p.IsPublished);

            return(Ok(published));
        }
Exemple #2
0
 public async Task OnGet()
 {
     PageSegments = await _blogPageService.ListSegmentAsync();
 }