@civicactions/cmsds-open-data-components 3.1.8-alpha.1 → 3.1.8-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +3 -2
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1331,6 +1331,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
1331
1331
|
...additionalParams
|
|
1332
1332
|
};
|
|
1333
1333
|
const additionalParamsString = Object.keys(params).length ? `&${(0, $hgUW1$qs).stringify(params)}` : "";
|
|
1334
|
+
const enabled = enabledParam && id !== null && id != "";
|
|
1334
1335
|
const { data: data, isPending: isPending, error: error } = (0, $hgUW1$useQuery)({
|
|
1335
1336
|
queryKey: [
|
|
1336
1337
|
"datastore" + id + additionalParamsString
|
|
@@ -1338,7 +1339,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
1338
1339
|
queryFn: ()=>{
|
|
1339
1340
|
return fetch(`${rootUrl}/datastore/query/${id}?${additionalParamsString}`).then((res)=>res.json());
|
|
1340
1341
|
},
|
|
1341
|
-
enabled:
|
|
1342
|
+
enabled: enabled
|
|
1342
1343
|
});
|
|
1343
1344
|
(0, $hgUW1$useEffect)(()=>{
|
|
1344
1345
|
if (data) {
|
|
@@ -1351,7 +1352,7 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
|
|
|
1351
1352
|
data
|
|
1352
1353
|
]);
|
|
1353
1354
|
return {
|
|
1354
|
-
loading: isPending,
|
|
1355
|
+
loading: enabled ? isPending : false,
|
|
1355
1356
|
values: values,
|
|
1356
1357
|
count: count,
|
|
1357
1358
|
columns: columns,
|