mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Chat foreign key fixes
This commit is contained in:
@@ -27,26 +27,6 @@
|
||||
"type": "integer",
|
||||
"defaultZero": true
|
||||
}
|
||||
},
|
||||
"foreignKey": [
|
||||
{
|
||||
"keysFrom": [
|
||||
"reciever"
|
||||
],
|
||||
"table": "users",
|
||||
"keysTo": [
|
||||
"id"
|
||||
]
|
||||
},
|
||||
{
|
||||
"keysFrom": [
|
||||
"sender"
|
||||
],
|
||||
"table": "users",
|
||||
"keysTo": [
|
||||
"id"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -50,15 +50,6 @@ function setup(data: SubmoduleData): void {
|
||||
|
||||
socket.on('join', function (/*data*/) {
|
||||
socket.join(userid.toString())
|
||||
let currUser: any = dbtools.Select(userDB, 'users', {
|
||||
id: userid,
|
||||
})
|
||||
if (!currUser || currUser.length === 0) {
|
||||
// TODO: handle somehow?
|
||||
socket.disconnect()
|
||||
} else {
|
||||
currUser = currUser[0]
|
||||
}
|
||||
|
||||
const groups = dbtools
|
||||
.runStatement(
|
||||
|
Reference in New Issue
Block a user