Skip to content

Commit 83843dd

Browse files
atu816neighbor-peacegeistnine01001101CK
committed
Increased SQL save storage
Co-authored-by: Michael Costello <[email protected]> Co-authored-by: Steven Geiger <[email protected]> Co-authored-by: Yufa Li <[email protected]> Co-authored-by: Alexander Tu <[email protected]>
1 parent 5f8d051 commit 83843dd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

server/controllers/user.controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const retrieveSchema: RequestHandler = async (req, res, next) => {
100100
const updateColQuery = `SELECT pg_schema FROM users WHERE email = '${req.params.email}';`
101101
connection.query(updateColQuery, (err, data) => {
102102
if (err) return next(err)
103-
const schema = data as Array<{pg_schema: string}>;
103+
const schema = data as Array<{ pg_schema: string }>;
104104
return res.status(200).json(schema[0].pg_schema)
105105
})
106-
}
106+
}

server/routes/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Express, Request, Response, NextFunction } from 'express';
22
import { handleGoogleAuth } from '../controllers/auth.controller';
3-
import { retrieveSchema, userRegistration, verifyUser } from '../controllers/user.controller';
3+
import { retrieveSchema, saveSchema, userRegistration, verifyUser } from '../controllers/user.controller';
44
import { postgresRouter } from './postgres.router';
55
import mysqlRouter from './mysql.router';
66
import session from 'express-session';
@@ -49,6 +49,8 @@ const routes = async (app: Express) => {
4949

5050
app.use('/api/sql/mysql', mysqlRouter);
5151

52+
app.post('/api/saveSchema', saveSchema);
53+
5254
app.get('/api/retrieveSchema/:email', retrieveSchema);
5355

5456
app.post('/api/userRegistration', userRegistration);

0 commit comments

Comments
 (0)