diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index fd1ed2b..f242400 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -14,8 +14,8 @@
-
-
+
+
@@ -196,7 +196,7 @@
-
+
1713528225837
@@ -338,7 +338,15 @@
1716658499589
-
+
+
+ 1716889664199
+
+
+
+ 1716889664199
+
+
@@ -375,6 +383,7 @@
-
+
+
\ No newline at end of file
diff --git a/code/web/incoming_request_handlers.js b/code/web/incoming_request_handlers.js
index 0a2114b..2d13b29 100644
--- a/code/web/incoming_request_handlers.js
+++ b/code/web/incoming_request_handlers.js
@@ -8,18 +8,19 @@
*/
function handleIncoming(request, response, app, pool)
{
+
+ let query = 'SELECT * FROM Exercise WHERE ExerciseID = ?';
+ let parameters = [];
+
if (!request.hasOwnProperty('uid') || typeof request.uid !== 'number')
{
- response
- .status(400)
- .send(JSON.stringify({error: 'Missing valid UID in request'}));
- return;
- }
+ query = 'SELECT * FROM Exercise';
+ } else parameters.push(request.uid);
// Acquire database connection
pool.getConnection()
.then(conn => {
- conn.query('SELECT * FROM Exercise WHERE ExerciseID = ?', [request.uid])
+ conn.query(query, parameters)
.then(rows => {
if (rows.length === 0)
{