Implements search functionality and prepares for upcoming paging in v0.3.
This commit is contained in:
parent
852317d3a6
commit
2887fab53f
17 changed files with 174 additions and 15 deletions
|
@ -1,7 +1,17 @@
|
|||
namespace API.Extensions
|
||||
using System.Text.Json;
|
||||
using API.Helpers;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace API.Extensions
|
||||
{
|
||||
public class HttpExtensions
|
||||
public static class HttpExtensions
|
||||
{
|
||||
|
||||
public static void AddPaginationHeader(this HttpResponse response, int currentPage,
|
||||
int itemsPerPage, int totalItems, int totalPages)
|
||||
{
|
||||
var paginationHeader = new PaginationHeader(currentPage, itemsPerPage, totalItems, totalPages);
|
||||
response.Headers.Add("Pagination", JsonSerializer.Serialize(paginationHeader));
|
||||
response.Headers.Add("Access-Control-Expose-Headers", "Pagination");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue