@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.
- package/package.json +1 -1
- package/src/server.mjs +4 -4
package/package.json
CHANGED
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
|
|
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
|
|
30
|
+
return prisma.Connection.findUnique({ where: { id }})
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
async function cloneConnection(id, connection) {
|
|
34
|
-
await
|
|
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
|
|
46
|
+
await prisma.Connection.delete({ where: { id }})
|
|
47
47
|
} catch(err) {
|
|
48
48
|
// it may be necessary in rare situations (not sure...)
|
|
49
49
|
}
|