@statezero/core 0.2.25 → 0.2.26

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.
@@ -112,12 +112,18 @@ function processFieldPath(fieldPath, value, ModelClass, options = {}) {
112
112
  }
113
113
  // Recursively process the remaining path with the related model
114
114
  const innerResult = processFieldPath(fullRemainingPath, value, relatedModel, options);
115
+ // Build the full field path including any FK traversal before this M2M field
116
+ // e.g., for owner__roles__name, processedPath=['owner'], part='roles'
117
+ // so fullFieldPath becomes 'owner.roles'
118
+ const fullFieldPath = processedPath.length > 0
119
+ ? processedPath.join('.') + '.' + part
120
+ : part;
115
121
  // Build the required path for data picking (full dot-notation path)
116
122
  const innerRequiredPath = innerResult.requiredPath || innerResult.field;
117
- const requiredPath = `${part}.${innerRequiredPath}`;
123
+ const requiredPath = `${fullFieldPath}.${innerRequiredPath}`;
118
124
  // Wrap the inner result in $elemMatch for this M2M field
119
125
  return {
120
- field: part,
126
+ field: fullFieldPath,
121
127
  operator: { $elemMatch: { [innerResult.field]: innerResult.operator } },
122
128
  isM2M: true,
123
129
  requiredPath // Full path for data picking
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "type": "module",
5
5
  "module": "ESNext",
6
6
  "description": "The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate",