@jcbuisson/express-x 1.5.22 → 1.5.23

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/server.mjs +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jcbuisson/express-x",
3
- "version": "1.5.22",
3
+ "version": "1.5.23",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
package/src/server.mjs CHANGED
@@ -18,7 +18,7 @@ export function expressX(prisma, options = {}) {
18
18
  const cnx2Socket = {}
19
19
 
20
20
  async function createConnection(clientIP) {
21
- const connection = await app.service('Connection').create({
21
+ const connection = await prisma.Connection.create({
22
22
  data: {
23
23
  clientIP,
24
24
  }
@@ -27,11 +27,11 @@ export function expressX(prisma, options = {}) {
27
27
  }
28
28
 
29
29
  function getConnection(id) {
30
- return app.service('Connection').findUnique({ where: { id }})
30
+ return prisma.Connection.findUnique({ where: { id }})
31
31
  }
32
32
 
33
33
  async function cloneConnection(id, connection) {
34
- await app.service('Connection').update({
34
+ await prisma.Connection.update({
35
35
  where: { id },
36
36
  data: {
37
37
  clientIP: connection.clientIP,
@@ -43,7 +43,7 @@ export function expressX(prisma, options = {}) {
43
43
 
44
44
  async function deleteConnection(id) {
45
45
  try {
46
- await app.service('Connection')._delete({ where: { id }})
46
+ await prisma.Connection.delete({ where: { id }})
47
47
  } catch(err) {
48
48
  // it may be necessary in rare situations (not sure...)
49
49
  }