Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search filter net #215

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Fixed bugs
  • Loading branch information
OrigamiPaper225 committed Jul 21, 2023
commit 4341ea00dcac87ccb89bb52cb1a418e1d4bbbef0
40 changes: 23 additions & 17 deletions api/schema/RideSchema.js
Original file line number Diff line number Diff line change
@@ -2,16 +2,20 @@ import nodemailer from 'nodemailer'
import { UserTC, RideTC, LocationTC, User, Ride, Location } from '../models'
import { isRideFull } from '../utils/rideUtils'

const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
// TODO: Use OAuth instead 😳
user: process.env.SENDER_EMAIL,
pass: process.env.SENDER_EMAIL_PASSWORD,
},
})
if (process.env.SENDER_EMAI && process.env.SENDER_EMAIL_PASSWORD) {
const transporter = nodemailer.createTransport({
host: 'smtp.gmail.com',
port: 465,
secure: true,
auth: {
// TODO: Use OAuth instead 😳
user: process.env.SENDER_EMAIL,
pass: process.env.SENDER_EMAIL_PASSWORD,
},
})
}



/**
* Add relations since the Ride model has ObjectIds (references) for some fields
@@ -131,13 +135,15 @@ RideTC.addResolver({
</a>
</p>
`

transporter.sendMail({
to: `${owner.netid}@rice.edu`,
subject: subject,
text: plaintextBody,
html: htmlBody,
})
if (process.env.SENDER_EMAI && process.env.SENDER_EMAIL_PASSWORD) {

transporter.sendMail({
to: `${owner.netid}@rice.edu`,
subject: subject,
text: plaintextBody,
html: htmlBody,
})
}

return updatedRide
},
17 changes: 15 additions & 2 deletions client/src/Pages/Search/Form.js
Original file line number Diff line number Diff line change
@@ -7,9 +7,22 @@ const Form = (props) => {

const resultRides = props.resultRides;
const displayRef = props.displayRef;
const locations = props.locationsAll;
if (props.locationsAll) {
var locations = props.locationsAll
var {locationMany : locationsArr} = locations
} else {
var locationsArr = [{title:'Rice',address:'6100 Main St, Houston, TX 77005, USA'},
{title:'Hobby (HOU) Airport',address:'Hobby Airport Loop, Houston, TX 77061, USA'},
{title:'IAH Airport',address:'2800 N Terminal Rd, Houston, TX 77032, USA'},
{title:'Galleria',address:'5085 Westheimer Rd, Houston, TX 77056'},
{title:'Target',address:'8500 Main St, Houston, TX 77025'},
{title:'H-E-B',address:'1701 W Alabama St, Houston, TX 77098'},
{title:'Houston',address:'[specify Houston address in notes]'},
{title:'Austin',address:'[specify Austin address in notes]'},
{title:'Dallas/Fort Worth',address:'[specify Dallas/Fort Worth address in notes]'},
{title:'San Antonio',address:'[specify San Antonio address in notes]'}];
}

const {locationMany : locationsArr} = locations

// May cause 401 error if a request is made to the database before it's ready
return (