Skip to content

Commit c670b83

Browse files
committed
Fix #1 - remove empty and params
1 parent 501cfeb commit c670b83

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

packages/base/components/ODataGridBase.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,14 @@ const ODataGridBase = <ComponentProps extends IGridProps,
8080
.reduce((a: Expand[], b) => Array.isArray(b) ? a.concat(b) : [...a, b], []);
8181

8282
const query = new URLSearchParams();
83-
query.append("$select", Array.from(fields).join(","));
84-
query.append("$expand", ExpandToQuery(expands));
83+
if (fields.size > 0) {
84+
query.append("$select", Array.from(fields).join(","));
85+
}
86+
87+
if (expands.length > 0) {
88+
query.append("$expand", ExpandToQuery(expands));
89+
}
90+
8591
query.append("$top", pageSize.toString());
8692
query.append("$skip", (pageNumber * pageSize).toString());
8793

packages/o-data-grid-pro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "o-data-grid-pro",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "A React Data Grid and Query Builder for OData APIs. Based on the Material-UI DataGridPro.",
55
"main": "build/o-data-grid-pro-cjs.js",
66
"module": "build/o-data-grid-pro-esm.js",

packages/o-data-grid/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "o-data-grid",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "A React Data Grid and Query Builder for OData APIs. Based on the Material-UI DataGrid.",
55
"main": "build/o-data-grid-cjs.js",
66
"module": "build/o-data-grid-esm.js",

0 commit comments

Comments
 (0)