@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 +1 -1
- package/src/orm-request.js +2 -0
package/package.json
CHANGED
package/src/orm-request.js
CHANGED
|
@@ -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
|
|