@jcbuisson/express-x 1.0.20 → 1.0.22
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/index.mjs +4 -1
package/package.json
CHANGED
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
|
|
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,9 @@ function expressX(app, options={}) {
|
|
|
71
71
|
return prisma[entity].upsert(options)
|
|
72
72
|
},
|
|
73
73
|
})
|
|
74
|
+
service.prisma = prisma
|
|
75
|
+
service.entity = entity
|
|
76
|
+
|
|
74
77
|
if (options.debug) console.log(`created service '${name}' over table '${entity}'`)
|
|
75
78
|
return service
|
|
76
79
|
}
|