Skip to content

Commit

Permalink
added where clause
Browse files Browse the repository at this point in the history
  • Loading branch information
michellelin1 committed Feb 5, 2024
1 parent 1958d44 commit 240d2a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions routes/publishedSchedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ publishedScheduleRouter.get('/season', async (req, res) => {
`
WITH seasonPS AS
(
SELECT
SELECT
PS.id,
C.title,
C.event_type,
Expand All @@ -70,7 +70,7 @@ publishedScheduleRouter.get('/season', async (req, res) => {
PS.notes
FROM published_schedule PS
LEFT JOIN catalog C ON PS.event_id = C.id
WHERE
WHERE
DATE(start_time) >= $1::date AND DATE(start_time) <= $2::date
)
SELECT DATE(seasonPS.start_time), JSON_AGG(seasonPS.*) AS data
Expand All @@ -92,7 +92,7 @@ publishedScheduleRouter.get('/date', async (req, res) => {
const { date } = req.query;
const seasonResult = await db.query(
`
SELECT
SELECT
PS.id,
C.title,
C.event_type,
Expand All @@ -105,7 +105,7 @@ publishedScheduleRouter.get('/date', async (req, res) => {
PS.notes
FROM published_schedule PS
LEFT JOIN catalog C ON PS.event_id = C.id
DATE(PS.start_time) = $1
WHERE DATE(PS.start_time) = $1
ORDER BY start_time ASC;
`,
[date],
Expand Down

0 comments on commit 240d2a6

Please sign in to comment.