Posted on 12/07/2023 13:20:05
Hi Theodor.
I can give you that - the response could benefit from having an encapsulating viewmodel containing information about totals.
I have created a new endpoint, GET dwapi/ecommerce/carts/list, devops#14646 that returns a list object with paging information:
https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_git/Dynamicweb/pullrequest/9486
public class UserCartsListResponse
{
/// <summary>
/// Gets or sets the items count per page.
/// </summary>
public int PageSize { get; set; }
/// <summary>
/// Gets or sets the count of pages.
/// If this value is greater than 0, the view model result will be paginated, otherwise, plain list.
/// </summary>
public int PageCount { get; set; }
/// <summary>
/// Gets or sets the current page number.
/// </summary>
public int CurrentPage { get; set; }
/// <summary>
/// Gets or sets the total number of orders in the list.
/// </summary>
public int TotalCartsCount { get; set; }
/// <summary>
/// Gets or sets the list of carts, see <see cref="UserCartsResponse"/>
/// </summary>
public List<UserCartsResponse> Carts { get; set; }
}