summary refs log tree commit diff
path: root/src/api/routes/stop.ts
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 22:29:30 +1000
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2022-09-26 22:41:21 +1000
commit99ee7e9400f06e8718612d8b52d15215dc620774 (patch)
tree08de8c5d3985b9c2eaa419f5198f891ecd82d012 /src/api/routes/stop.ts
parentRemove the cdn storage location log (diff)
downloadserver-99ee7e9400f06e8718612d8b52d15215dc620774.tar.xz
Prettier
Diffstat (limited to 'src/api/routes/stop.ts')
-rw-r--r--src/api/routes/stop.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/api/routes/stop.ts b/src/api/routes/stop.ts
index 7f8b78ba..78abb9d7 100644
--- a/src/api/routes/stop.ts
+++ b/src/api/routes/stop.ts
@@ -6,17 +6,19 @@ const router: Router = Router();
 
 router.post("/", route({}), async (req: Request, res: Response) => {
 	//EXPERIMENTAL: have an "OPERATOR" platform permission implemented for this API route
-	const user = await User.findOneOrFail({ where: { id: req.user_id }, select: ["rights"] });
-	if((Number(user.rights) << Number(0))%Number(2)==Number(1)) {
+	const user = await User.findOneOrFail({
+		where: { id: req.user_id },
+		select: ["rights"],
+	});
+	if ((Number(user.rights) << Number(0)) % Number(2) == Number(1)) {
 		console.log("user that POSTed to the API was ALLOWED");
 		console.log(user.rights);
-		res.sendStatus(200)
-		process.kill(process.pid, 'SIGTERM')
-	}
-	else {
+		res.sendStatus(200);
+		process.kill(process.pid, "SIGTERM");
+	} else {
 		console.log("operation failed");
 		console.log(user.rights);
-		res.sendStatus(403)
+		res.sendStatus(403);
 	}
 });