Add filtering by tags

This commit is contained in:
2025-10-06 10:42:32 +03:00
parent 252070a045
commit 0c179993d9
2 changed files with 68 additions and 2 deletions

View File

@@ -259,9 +259,9 @@ public class PostController(
[HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<ActionResult<PagedList<PostDto>>> GetAll([Range(1, int.MaxValue)] int pageNumber = 1)
public async Task<ActionResult<PagedList<PostDto>>> GetAll(string? query, [Range(1, int.MaxValue)] int pageNumber = 1)
{
var list = await postService.GetAll(pageNumber);
var list = await postService.FindAll(query, pageNumber);
var newItems = list.Items.Select(i =>
{
var fileUrl = Url.Action(nameof(PatchFileContent), "Post",