Skip to content

Commit 48ecc3a

Browse files
Right Swipes stored and message when matched done
1 parent 1bf62fd commit 48ecc3a

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Backend/app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ def get_recommendations():
282282
rec_names = pipelining.predict(skill_arr)
283283
# NOTE For testing
284284
# rec_names = ["Dummy_a", "Dummy_ab"]
285+
# rec_names = ["Sidhant Khamankar"]
285286
# id, name, photo, headline, requirements, info created using branch-year-batch, skills
286287
cards = list()
287288
for rec_name in rec_names:

Frontend/components/Discover.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,20 @@ function Discover() {
117117
setIndex(index + 1);
118118
};
119119

120-
const onSwipedRight = index => {
120+
const onSwipedRight = async index => {
121121
console.log(index, 'Right');
122+
const res = await axiosInstance.post('/right_swipe', {
123+
Swiped_Student_ID: cards[index].id,
124+
});
125+
if (res.data === 'Matched') {
126+
console.log('Matched');
127+
const msg = await axiosInstance.post('/message', {
128+
Receiver_ID: cards[index].id,
129+
text: 'Hi, 👋 We matched up',
130+
});
131+
} else {
132+
console.log('Yet to Match');
133+
}
122134
setIndex(index + 1);
123135
};
124136

Frontend/components/GoogleLogin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ function GoogleLogin() {
4040
res_access_token = await axiosInstance
4141
.post('/signup_and_login', {
4242
username: userInfo.user.name.toLowerCase(),
43+
//NOTE For testing
44+
// username: 'Dummy_a',
4345
})
4446
.catch(err => {
4547
console.error('Access_token Error : ' + err);

0 commit comments

Comments
 (0)