This commit is contained in:
David Štaleker
2024-03-12 19:04:38 +01:00
parent dda4b613f8
commit c6d14525de
5 changed files with 128 additions and 4 deletions

View File

@@ -35,6 +35,30 @@ namespace ZpcBulletinBoard.Pages.Boards
return Page();
}
//GET
public IActionResult OnGetPages(string guid)
{
var board = context.BulletinBoards
.Include(x => x.Links.OrderBy(x => x.Order))
.ThenInclude(x => x.BulletinBoardPage)
.FirstOrDefault(x => x.Guid.ToString() == guid);
var links = new List<BulletinBoardPageLink>();
if (board is not { Links: not null }) return new JsonResult(new { successful = true, links });
links.AddRange(board.Links);
foreach (var link in links)
{
link.BulletinBoardPage.Links = null;
link.BulletinBoard.Links = null;
}
return new JsonResult(new { successful = true, links });
}
}
}