useDataGrid not compatible with my api
const { dataGridProps } = useDataGrid<IColor>({
pagination: {
pageSize: 5,
},
});
im using useDataGrid to fetch resource color from dataProvider, but the thing is my api give response like this:
{
"hasErrors": false,
"content": {
"data": [
{
"id": "11d1a5e2-3a6a-4b06-a1c1-e4a93f724b57",
"code": "123wwws2",
"name": "12345678s9223",
"status": "IN_ACTIVE"
},
...
],
"totalPages": 3,
"currentPage": 0
},
"errors": "",
"timestamp": [
2023,
...
],
"status": 200
}
then i end up getting wrong dataGridProps like this:
{
"disableRowSelectionOnClick": true,
"rows": {
"hasErrors": false,
"content": {
"data": [
{
"id": "11d1a5e2-3a6a-4b06-a1c1-e4a93f724b57",
"code": "123wwws2",
"name": "12345678s9223",
"status": "IN_ACTIVE"
},
...
],
"totalPages": 3,
"currentPage": 0
},
"errors": "",
"timestamp": [
2023,
10,
17,
15,
2,
26,
836912300
],
"status": 200
},
"loading": false,
"rowCount": 0,
"paginationMode": "server",
"paginationModel": {
"page": 0,
"pageSize": 5
},
"sortingMode": "server",
"sortModel": [],
"filterMode": "server",
"filterModel": {
"items": [],
"logicOperator": "and"
},
"sx": {
"border": "none",
"& .MuiDataGrid-columnHeaders": {
"background": "rgb(242, 242, 242)",
"borderBottom": "1px solid rgb(229, 229, 229)"
},
"& .MuiDataGrid-cell": {
"borderBottom": "1px solid rgb(242, 242, 242)"
}
}
}
pls help
pagination: {
pageSize: 5,
},
});
im using useDataGrid to fetch resource color from dataProvider, but the thing is my api give response like this:
{
"hasErrors": false,
"content": {
"data": [
{
"id": "11d1a5e2-3a6a-4b06-a1c1-e4a93f724b57",
"code": "123wwws2",
"name": "12345678s9223",
"status": "IN_ACTIVE"
},
...
],
"totalPages": 3,
"currentPage": 0
},
"errors": "",
"timestamp": [
2023,
...
],
"status": 200
}
then i end up getting wrong dataGridProps like this:
{
"disableRowSelectionOnClick": true,
"rows": {
"hasErrors": false,
"content": {
"data": [
{
"id": "11d1a5e2-3a6a-4b06-a1c1-e4a93f724b57",
"code": "123wwws2",
"name": "12345678s9223",
"status": "IN_ACTIVE"
},
...
],
"totalPages": 3,
"currentPage": 0
},
"errors": "",
"timestamp": [
2023,
10,
17,
15,
2,
26,
836912300
],
"status": 200
},
"loading": false,
"rowCount": 0,
"paginationMode": "server",
"paginationModel": {
"page": 0,
"pageSize": 5
},
"sortingMode": "server",
"sortModel": [],
"filterMode": "server",
"filterModel": {
"items": [],
"logicOperator": "and"
},
"sx": {
"border": "none",
"& .MuiDataGrid-columnHeaders": {
"background": "rgb(242, 242, 242)",
"borderBottom": "1px solid rgb(229, 229, 229)"
},
"& .MuiDataGrid-cell": {
"borderBottom": "1px solid rgb(242, 242, 242)"
}
}
}
pls help
