aboutsummaryrefslogtreecommitdiffstats
path: root/backend/src/routes/userRoutes.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-30 00:58:56 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-30 00:58:56 -0700
commitfae6914acace1a3b470f9d243fe8a2ba0f141388 (patch)
treecc2ac24b97b464189c220d6c5abe7d48e92f28aa /backend/src/routes/userRoutes.ts
parent722df5105c098f404e09e884a817acf92d939648 (diff)
add basic batch manual score upload route
Diffstat (limited to 'backend/src/routes/userRoutes.ts')
-rw-r--r--backend/src/routes/userRoutes.ts41
1 files changed, 0 insertions, 41 deletions
diff --git a/backend/src/routes/userRoutes.ts b/backend/src/routes/userRoutes.ts
deleted file mode 100644
index a03ece0..0000000
--- a/backend/src/routes/userRoutes.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-// Routes about self (or users in general)
-import express from 'express';
-import { prisma } from '../config/db';
-
-export const handleMeRoute = async (req: express.Request, res: express.Response) => {
- try {
- const user = (req as any).user;
- res.json(user);
- } catch (error) {
- console.error('Me endpoint error:', error);
- res.status(500).json({ error: 'Internal server error' });
- }
-}
-
-export const handleGetCurrentSession = async (req: express.Request, res: express.Response) => {
- try {
- if (!req.session.userId) {
- return res.json({ authenticated: false });
- }
-
- const user = await prisma.user.findUnique({
- where: { id: req.session.userId },
- select: { id: true, username: true, email: true }
- });
-
- if (!user) {
- req.session.destroy((err) => {
- if (err) console.error('Session destroy error:', err);
- });
- return res.json({ authenticated: false });
- }
-
- res.json({
- authenticated: true,
- user
- });
- } catch (error) {
- console.error('Session check error:', error);
- res.status(500).json({ error: 'Internal server error' });
- }
-}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage