feat: Adding product-categories endpoint

This commit is contained in:
2023-10-05 23:39:21 -06:00
parent 857a8bf18b
commit bf65d9a5cf
4 changed files with 33 additions and 1 deletions

View File

@@ -8,6 +8,9 @@ function getPagination( query ){
if( query.page ){
limit.page = parseInt( query.page ) || 0;
if( limit.page < 0 ){
limit.page = 0;
}
}
if( query.elements ){
limit.elements = parseInt( query.elements ) || 10;
@@ -15,6 +18,9 @@ function getPagination( query ){
if( limit.elements > 1000 ){
limit.elements = 1000;
}
else if( limit.elements < 0 ){
limit.elements = 10;
}
}
return limit;
}