Skip to content

Commit

Permalink
Merge branch 'dev' into frontend-issue-44-student-user-flow-view
Browse files Browse the repository at this point in the history
  • Loading branch information
michellelin1 authored Mar 5, 2024
2 parents ab3da49 + 5d962dc commit b09ee33
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions routes/publishedSchedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
6 changes: 3 additions & 3 deletions routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions server/schema/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

0 comments on commit b09ee33

Please sign in to comment.