Skip to content

Commit

Permalink
Merge pull request #135 from agiledev-students-spring2024/compat
Browse files Browse the repository at this point in the history
Compat
  • Loading branch information
bobbyimpastato authored Apr 17, 2024
2 parents ce89e6d + 2c4040d commit cc30072
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 53 deletions.
15 changes: 9 additions & 6 deletions back-end/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,15 @@ app.post('/register', async (req, res) => {
}

const hashedPassword = await bcrypt.hash(password, 10);
const newUser = new User({
username,
password: hashedPassword
});

await newUser.save();
// const newUser = new User({
// username,
// password: hashedPassword
// });

newUser.username = username;
newUser.password = hashedPassword;

//await newUser.save();
console.log('User registered successfully');
res.status(201).json({ message: "User registered successfully." });
} catch (err) {
Expand Down
67 changes: 29 additions & 38 deletions back-end/Compatibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,36 @@ const BarackObama = {
username: "BarackObama",
password: "obamaSecure456"
},

profile: {
name: "Barack Obama",
year: "Freshman",
bio: "Yes we can!"
},

answers: {
//info
gender: "male", //male, female, other
year: "freshman", //freshman, sophomore, junoir, senior, other
pets: "no", //yes, no
//living style
guests: "often", //often, sometimes, never
smoke: "never",
drink: "sometimes",
//rent range
rent_max: 4000,
rent_min: 1000,
//living habits
bedtime: 2, //1(before 10), 2(10pm-12am), 3(12am-2am), 4(2am-4am), 5(after 4am), 0(depends)
quietness : 2, //rank out of 1-5
cleanliness: 4 //rank out of 1-5
},

preferences: {
//info
gender: "same", //same, okay(with anything)
year: "okay", //same, okay
pets: "yes", //yes, no
//living style
guests: "yes", //yes, no
smoke: "yes", //yes, no
drink: "yes", //yes, no
//living habits
bedtime: "similar", //similar, okay
quietness: "okay", //similar, okay
cleanliness: "okay" //similar, okay
}
name: "",
year: "",
bio: ""
},
answers: {
gender: "",
year: "",
pets: "",
guests: "",
smoke: "",
drink: "",
rent_max: 0,
rent_min: 0,
bedtime: 0,
quietness : 0,
cleanliness: 0
},
preferences: {
gender: "",
year: "",
pets: "",
guests: "",
smoke: "",
drink: "",
bedtime: "",
quietness: "",
cleanliness: ""
}

};

const TaylorSwift = {
Expand Down
1 change: 0 additions & 1 deletion back-end/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const mongoose = require('mongoose');
const UserSchema = new mongoose.Schema({
username: String,
password: String,

profile: {
name: String,
year: String,
Expand Down
10 changes: 2 additions & 8 deletions back-end/fakedata.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"BarackObama": {
"login": {
"username": "BarackObama",
"password": "obamaSecure456"
},
"username": "BarackObama",
"password": "obamaSecure456",

"profile": {
"name": "Barack Obama",
Expand Down Expand Up @@ -41,10 +39,6 @@
"bedtime": "okay",
"quietness" : "similar",
"cleanliness": "similar"
},

"matches": {
"TaylorSwift": 22
}
}
}

0 comments on commit cc30072

Please sign in to comment.