Skip to content

Commit

Permalink
edited knex query so it executes successfully (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
llam280 authored Aug 22, 2024
1 parent eb87dad commit 0d76145
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/controllers/routines-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d76145

Please sign in to comment.