@statezero/core 0.1.6 → 0.1.7

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.
@@ -227,22 +227,6 @@ export class {{className}} extends Model {
227
227
  });
228
228
  });
229
229
  }
230
-
231
- /**
232
- * Serialize the model's data.
233
- * Returns a plain object containing the current values of all fields,
234
- * including raw IDs for relationship fields.
235
- * @returns {Object}
236
- */
237
- serialize() {
238
- const data = {};
239
- // Simply assign the current value of each field.
240
- // No special handling or PK extraction for relationships here.
241
- {{#each properties}}
242
- data.{{name}} = this.{{name}};
243
- {{/each}}
244
- return data;
245
- }
246
230
  }
247
231
  `;
248
232
  // Updated TS_DECLARATION_TEMPLATE with improved relationship handling
@@ -165,18 +165,6 @@ export class Model {
165
165
  if (storedValue)
166
166
  value = storedValue[field];
167
167
  }
168
- if (ModelClass.relationshipFields &&
169
- ModelClass.relationshipFields.has(field) &&
170
- value) {
171
- let fieldInfo = ModelClass.relationshipFields.get(field);
172
- switch (fieldInfo.relationshipType) {
173
- case "many-to-many":
174
- return value.map((instance) => instance.pk ? instance.pk : instance);
175
- case "one-to-one":
176
- case "foreign-key":
177
- return value.pk ? value.pk : value;
178
- }
179
- }
180
168
  return value;
181
169
  }
182
170
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statezero/core",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
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",