@civicactions/cmsds-open-data-components 4.0.16-alpha.0 → 4.0.16-alpha.1

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 CHANGED
@@ -3723,16 +3723,6 @@ var $2eec38d4d0dbf714$export$2e2bcd8739ae039 = $2eec38d4d0dbf714$var$ClearFilter
3723
3723
  function $6f4318b1e14124e5$var$updateQueryForDatastore(condition) {
3724
3724
  let cond = condition;
3725
3725
  delete cond.key;
3726
- if (cond.operator === 'is_empty') {
3727
- cond.operator = '=';
3728
- cond.value = '';
3729
- return cond;
3730
- }
3731
- if (cond.operator === 'not_empty') {
3732
- cond.operator = '<>';
3733
- cond.value = '';
3734
- return cond;
3735
- }
3736
3726
  if (cond.operator === '=' || cond.operator === '<>') {
3737
3727
  if (Array.isArray(cond.value)) cond.value = cond.value.join();
3738
3728
  cond.value = cond.value.replace(/(^\%+|\%+$)/gm, '');
@@ -5317,11 +5307,24 @@ const $1d3d480a9cfaabe0$var$useDatastore = (resourceId, rootAPIUrl, options, add
5317
5307
  const datasetID = additionalParams.datasetID;
5318
5308
  // Remove datasetID from params to avoid sending it to the API
5319
5309
  const { datasetID: _, ...restAdditionalParams } = additionalParams;
5310
+ const apiConditions = conditions?.map((c)=>{
5311
+ if (c.operator === 'is_empty') return {
5312
+ ...c,
5313
+ operator: '=',
5314
+ value: ''
5315
+ };
5316
+ if (c.operator === 'not_empty') return {
5317
+ ...c,
5318
+ operator: '<>',
5319
+ value: ''
5320
+ };
5321
+ return c;
5322
+ });
5320
5323
  let params = {
5321
5324
  keys: keys,
5322
5325
  limit: limit,
5323
5326
  offset: offset,
5324
- conditions: conditions,
5327
+ conditions: apiConditions,
5325
5328
  sorts: sort,
5326
5329
  properties: properties,
5327
5330
  groupings: groupings,