Merged type fixes

This commit is contained in:
mrfry 2022-03-22 11:23:17 +01:00
commit 85b5acc692
22 changed files with 583 additions and 150 deletions

View file

@ -1,3 +1,23 @@
/* ----------------------------------------------------------------------------
Question Server
GitLab: <https://gitlab.com/MrFry/mrfrys-node-server>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
------------------------------------------------------------------------- */
import { Server as socket, Socket } from 'socket.io'
import utils from '../../../utils/utils'
@ -179,15 +199,8 @@ function setup(data: SubmoduleData): void {
})
app.get('/hasNewMsg', (req: Request, res) => {
let userid: any = req.query.userid
if (!userid || isNaN(userid)) {
res.json({
success: false,
msg: 'Query "userid" (number) is required!',
})
return
}
userid = parseInt(userid)
const user: User = req.session.user
const userid: number = user.id
const groups = dbtools
.runStatement(