jsonapi_paginator v0.1.1 JsonapiPaginator View Source
Simple pagination links renderer for the JSON API
Link to this section Summary
Functions
Render links based on the data, given in params map
Link to this section Functions
Link to this function
render_links(params) View Source
Render links based on the data, given in params map
%{
base_url: base_url,
page_number: page_number,
page_size: page_size,
total_pages: total_pages,
total_count: total_count
}
Returns map | %{}
Sample return map:
%{
first: "http://localhost/api/v1/get_page?number=1&size=10",
last: "http://localhost/api/v1/get_page?number=10&size=10",
next: "http://localhost/api/v1/get_page?number=3&size=10",
prev: "http://localhost/api/v1/get_page?number=1&size=10",
self: "http://localhost/api/v1/get_page?number=2&size=10"
}