Skip to content

Commit

Permalink
Fix #1 - remove empty and params
Browse files Browse the repository at this point in the history
  • Loading branch information
jamerst committed Oct 16, 2022
1 parent 501cfeb commit c670b83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/base/components/ODataGridBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ const ODataGridBase = <ComponentProps extends IGridProps,
.reduce((a: Expand[], b) => Array.isArray(b) ? a.concat(b) : [...a, b], []);

const query = new URLSearchParams();
query.append("$select", Array.from(fields).join(","));
query.append("$expand", ExpandToQuery(expands));
if (fields.size > 0) {
query.append("$select", Array.from(fields).join(","));
}

if (expands.length > 0) {
query.append("$expand", ExpandToQuery(expands));
}

query.append("$top", pageSize.toString());
query.append("$skip", (pageNumber * pageSize).toString());

Expand Down
2 changes: 1 addition & 1 deletion packages/o-data-grid-pro/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "o-data-grid-pro",
"version": "1.3.0",
"version": "1.3.1",
"description": "A React Data Grid and Query Builder for OData APIs. Based on the Material-UI DataGridPro.",
"main": "build/o-data-grid-pro-cjs.js",
"module": "build/o-data-grid-pro-esm.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/o-data-grid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "o-data-grid",
"version": "1.3.0",
"version": "1.3.1",
"description": "A React Data Grid and Query Builder for OData APIs. Based on the Material-UI DataGrid.",
"main": "build/o-data-grid-cjs.js",
"module": "build/o-data-grid-esm.js",
Expand Down

0 comments on commit c670b83

Please sign in to comment.