dev
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user