@stonyx/orm 0.2.3-alpha.0 → 0.2.5-alpha.0

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "stonyx-async",
5
5
  "stonyx-module"
6
6
  ],
7
- "version": "0.2.3-alpha.0",
7
+ "version": "0.2.5-alpha.0",
8
8
  "description": "",
9
9
  "main": "src/main.js",
10
10
  "type": "module",
@@ -222,6 +222,8 @@ export default class OrmRequest extends Request {
222
222
 
223
223
  const fieldsMap = parseFields(request.query);
224
224
  const modelFields = fieldsMap.get(pluralizedModel) || fieldsMap.get(model);
225
+ // Check for duplicate ID
226
+ if (attributes.id !== undefined && store.get(model, attributes.id)) return 409; // Conflict
225
227
 
226
228
  const record = createRecord(model, attributes, { serialize: false });
227
229