Skip to content

Commit ac6ffdf

Browse files
committed
emit event on what users to fetch
1 parent 90ad76c commit ac6ffdf

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

frontend/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div id="app" class="antialiased" v-bind:style="{background: getBackground}">
3-
<keep-alive include="Browse,Search">
3+
<keep-alive include="Browse,Search,History">
44
<router-view/>
55
</keep-alive>
66
</div>

frontend/src/components/app/recommendations/HistoryRecommendations.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ export default {
171171
}
172172
return recommendations;
173173
},
174-
saveSingleChoice() {
175-
console.log('bingo');
174+
saveSingleChoice(...args) {
175+
const [key, value] = args;
176+
if (key === 'history') {
177+
this.$emit('update-history', value);
178+
}
176179
},
177180
},
178181
watch: {

frontend/src/views/app/History.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<section class="mx-auto">
66
<HistoryRecommendations
77
v-if="recommendationsAnalysisDone"
8+
v-on:update-history="updateHistory"
89
v-bind:title="'Potential matches'"
910
v-bind:recommendationsReceived="recommendations"
1011
v-bind:recommendationsAnalysis="recommendationsAnalysis"></HistoryRecommendations>
@@ -19,7 +20,7 @@ import NavBar from '@/components/shared/NavBar.vue';
1920
import HistoryRecommendations from '@/components/app/recommendations/HistoryRecommendations.vue';
2021
2122
export default {
22-
name: 'Browse',
23+
name: 'History',
2324
props: ['recommendationsFromSettingUp'],
2425
components: {
2526
NavBar,
@@ -98,6 +99,20 @@ export default {
9899
this.recommendationsAnalysis.interests = [];
99100
this.recommendationsAnalysisDone = false;
100101
},
102+
updateHistory(...args) {
103+
const [request] = args;
104+
if (request === 'People I view') {
105+
console.log(1);
106+
} else if (request === 'People I like') {
107+
console.log(2);
108+
} else if (request === 'Who views me') {
109+
console.log(3);
110+
} else if (request === 'Who likes me') {
111+
console.log(4);
112+
} else if (request === 'Whom I block') {
113+
console.log(5);
114+
}
115+
},
101116
},
102117
async created() {
103118
await this.fetchUsers();

0 commit comments

Comments
 (0)