@jcbuisson/express-x 1.0.20 → 1.0.21

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.mjs +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
package/src/index.mjs CHANGED
@@ -19,7 +19,7 @@ function expressX(app, options={}) {
19
19
  /*
20
20
  * create a service `name` based on Prisma table `entity`
21
21
  */
22
- function createDatabaseService(name, { entity=name, client='prisma' }) {
22
+ function createDatabaseService(name, { entity=name }) {
23
23
  let prisma = app.get('prisma')
24
24
  if (!prisma) {
25
25
  prisma = new PrismaClient()
@@ -71,6 +71,8 @@ function expressX(app, options={}) {
71
71
  return prisma[entity].upsert(options)
72
72
  },
73
73
  })
74
+ service.entity = entity
75
+
74
76
  if (options.debug) console.log(`created service '${name}' over table '${entity}'`)
75
77
  return service
76
78
  }