diff --git a/server/controllers/routines-controller.js b/server/controllers/routines-controller.js index b0dee68..8cd5c99 100644 --- a/server/controllers/routines-controller.js +++ b/server/controllers/routines-controller.js @@ -126,11 +126,11 @@ const getAllRoutineInfo = (req, res) => { knex('exercises_history') .join('exercises', 'exercises_history.name', '=', 'exercises.name') .join('routines', 'exercises_history.date', '=', 'routines.date') - .select('routines.name as routine_name', 'routines.date', 'exercises_history.set', 'exercises.name as exercise_name', 'exercises_history.weight', 'exercises.muscle_group') + .select('routines.name as routine_name', 'routines.date', 'exercises_history.sets', 'exercises.name as exercise_name', 'exercises_history.weight', 'exercises.muscle_group') .whereRaw('exercises_history.date = routines.date') .then(result => { // Send the query result back as a JSON response - res.json(result); + res.status(200).json(result); }) .catch(error => { // Handle any errors that occurred during the query