Skip to content
Permalink
Browse files
Fixed sign up problems
  • Loading branch information
Dorothy committed Nov 18, 2021
1 parent 32b4476 commit 2bac1503b86c10353a5966df0e8db5d73b9c3e39
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 10 deletions.
@@ -14,8 +14,18 @@ module.exports = (db) => {
});

router.post('/upperclassmen', (req, res) => {
r = db.addUpper(req.body, res);
r = db.addUpper(req.body, res);
});

router.get('/freshmen', (req, res) => {
r=db.collection.find({ "type": "freshmen" })
res.send(r);
})

router.get('/upperclassmen', (req, res) => {
r=db.collection.find({ "type": "upperclass" })
res.send(r);
})

return router;
}
@@ -12,7 +12,7 @@ router.post('/', async (req, res) => {

// check if user exists
let user = await User.findOne({name: req.body.name});
if (!user) return res.status(400).send('Invalid name or password.');
if (!user) return res.status(400).send('User not exist');

// check password
const validPass = await bcrypt.compare(req.body.pass, user.pass);
@@ -442,19 +442,19 @@ export default {
}
},
methods: {
validateForm(evt) {
validateForm(evt) {
evt.preventDefault();
// at least 1 block should be selected
if (this.blocksCount < 1) {
this.alertText = "At least 1 time block should be selected."
this.showAlert = true
return;
}
if (this.formData.majors.length > 2) {
this.alertText = "You can only select up to 2 majors."
this.showAlert = true
return;
}
//if (this.formData.majors.length > 2) {
//this.alertText = "You can only select up to 2 majors."
//this.showAlert = true
//return;
//}
this.$emit("validateSuccess") // validate success
},
clearHome() {
@@ -36,7 +36,10 @@ export default {
methods: {
async submitUnder() {
try {
await axios.post('/api/form/underclassmen', this.formData);
await axios.post('/api/form/underclassmen', this.formData)
.catch(function (error) {
console.log(error)
});
console.log('submit success');
this.$router.push('/landing');
} catch (e) {
@@ -35,7 +35,10 @@ export default {
methods: {
async submitUpper() {
try {
await axios.post('/api/form/upperclassmen', this.formData);
await axios.post('/api/form/upperclassmen', this.formData)
.catch(function (error) {
console.log(error)
});
console.log('submit success');
this.$router.push('/landing');
} catch (e) {

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,15 @@
{
"name": "meeteng",
"version": "1.0.0",
"description": "Prospective RPI students and freshmen meeting seniors of the same major.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.rpi.edu/goldsd3/meeteng"
},
"author": "",
"license": "ISC"
}

0 comments on commit 2bac150

Please sign in to comment.