diff --git a/routes/publishedSchedule.js b/routes/publishedSchedule.js index 32f4908..a515f27 100644 --- a/routes/publishedSchedule.js +++ b/routes/publishedSchedule.js @@ -183,6 +183,7 @@ publishedScheduleRouter.get('/season', async (req, res) => { WHERE D.event_date >= $1::date AND D.event_date <= $2::date AND D.id = PS.day_id + ORDER BY PS.start_time ASC ) SELECT event_date, json_build_object ( diff --git a/routes/users.js b/routes/users.js index 9f2b5cd..7f2ce2a 100644 --- a/routes/users.js +++ b/routes/users.js @@ -37,10 +37,10 @@ userRouter.get('/:uid', async (req, res) => { userRouter.post('/create', async (req, res) => { try { - const { id, email, type, approved, approvedOn } = req.body; + const { id, email, type, approved, approvedOn, firstName, lastName } = req.body; await db.query( - `INSERT INTO users (id, email, "type", approved, approved_on) VALUES ($1, $2, $3, $4, $5);`, - [id, email, type, approved, approvedOn], + `INSERT INTO users (id, email, "type", approved, approved_on, first_name, last_name) VALUES ($1, $2, $3, $4, $5, $6, $7);`, + [id, email, type, approved, approvedOn, firstName, lastName], ); res.status(201).json({ id, diff --git a/server/schema/users.sql b/server/schema/users.sql index 72a5ae9..f9598e0 100644 --- a/server/schema/users.sql +++ b/server/schema/users.sql @@ -8,4 +8,6 @@ CREATE TABLE users ( type account_type NOT NULL, approved BOOLEAN NOT NULL, approved_on DATE NOT NULL, + first_name VARCHAR(50) NOT NULL, + last_name VARCHAR(50) NOT NULL ); \ No newline at end of file