yaml-admin-api 0.0.92 → 0.0.94

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaml-admin-api",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "license": "MIT",
5
5
  "description": "YAML Admin API package",
6
6
  "type": "commonjs",
@@ -471,7 +471,6 @@ const generateCrud = async ({ app, db, entity_name, yml_entity, yml, options })
471
471
  if (entity[key_field.name] !== undefined)
472
472
  delete entity[key_field.name]
473
473
 
474
-
475
474
  //Custom Create Start
476
475
 
477
476
  //Custom Create End
@@ -496,8 +495,11 @@ const generateCrud = async ({ app, db, entity_name, yml_entity, yml, options })
496
495
  await db.collection(collection_name).updateOne(f, { $set: entity });
497
496
 
498
497
  //Custom Create Tail Start
499
- if(options?.listener?.entityUpdated)
500
- await options.listener.entityUpdated(db, entity_name, entity)
498
+ if(options?.listener?.entityUpdated) {
499
+ let entityWithId = { ...entity }
500
+ entityWithId[key_field.name] = entityId
501
+ await options.listener.entityUpdated(db, entity_name, entityWithId)
502
+ }
501
503
  //Custom Create Tail End
502
504
 
503
505
  // Ensure React-Admin receives an `id` in the response