Fix failure when checking bans
Forgot to provide the userid to check to checkBan queriesmaster
parent
7de73c9565
commit
e5f96b966a
|
@ -71,7 +71,7 @@ app.post("/api/addRequest", async (request, response) => {
|
||||||
response.send("Must be logged in");
|
response.send("Must be logged in");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var banned = await db.query(queries.checkBan).then((result: pg.QueryResult) => result.rowCount > 0);
|
var banned = await db.query(Object.assign(queries.checkBan, { values: [request.session.user.id] })).then((result: pg.QueryResult) => result.rowCount > 0);
|
||||||
if (banned) {
|
if (banned) {
|
||||||
response.status(401);
|
response.status(401);
|
||||||
response.send("You are banned; you may not add new requests.");
|
response.send("You are banned; you may not add new requests.");
|
||||||
|
@ -192,7 +192,7 @@ app.post("/api/addVote", async (request,response) => {
|
||||||
response.send("Must be logged in");
|
response.send("Must be logged in");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var banned = await db.query(queries.checkBan).then((result: pg.QueryResult) => result.rowCount > 0);
|
var banned = await db.query(Object.assign(queries.checkBan,{ values: [request.session.user.id] })).then((result: pg.QueryResult) => result.rowCount > 0);
|
||||||
if (banned) {
|
if (banned) {
|
||||||
response.status(401);
|
response.status(401);
|
||||||
response.send("You are banned; you may not vote on requests.");
|
response.send("You are banned; you may not vote on requests.");
|
||||||
|
|
Loading…
Reference in New Issue