diff --git a/back-end/App.js b/back-end/App.js index 74405a6..5329293 100644 --- a/back-end/App.js +++ b/back-end/App.js @@ -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) { diff --git a/back-end/Compatibility.js b/back-end/Compatibility.js index 2680444..ba7c1ad 100644 --- a/back-end/Compatibility.js +++ b/back-end/Compatibility.js @@ -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 = { diff --git a/back-end/db.js b/back-end/db.js index 9d09c86..1969b74 100644 --- a/back-end/db.js +++ b/back-end/db.js @@ -4,7 +4,6 @@ const mongoose = require('mongoose'); const UserSchema = new mongoose.Schema({ username: String, password: String, - profile: { name: String, year: String, diff --git a/back-end/fakedata.json b/back-end/fakedata.json index 655cde9..c7dd890 100644 --- a/back-end/fakedata.json +++ b/back-end/fakedata.json @@ -1,9 +1,7 @@ { "BarackObama": { - "login": { - "username": "BarackObama", - "password": "obamaSecure456" - }, + "username": "BarackObama", + "password": "obamaSecure456", "profile": { "name": "Barack Obama", @@ -41,10 +39,6 @@ "bedtime": "okay", "quietness" : "similar", "cleanliness": "similar" - }, - - "matches": { - "TaylorSwift": 22 } } }