Skip to content

Commit 922092d

Browse files
committed
report contacting backend
1 parent debf6fe commit 922092d

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

frontend/src/components/app/users/UserProfile.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@
6363
v-bind:name="'report'"
6464
v-bind:starting-option="'harassment'"
6565
v-bind:options="['harassment', 'bot', 'spam', 'inappropriate content']"></DropdownDisplayChoice>
66-
<h1 class="onboarding-sub-container-content-button-outline mx-auto">Report</h1>
66+
<h1 v-on:click="makeReport()" class="onboarding-sub-container-content-button-outline mx-auto">Report</h1>
6767
</div>
6868
<div class="text-center p-8">
69-
<h1 class="onboarding-sub-container-content-button-outline text-red-500 mt-0 border-red-500 mx-auto">Block</h1>
69+
<h1
70+
v-on:click="block()"
71+
class="onboarding-sub-container-content-button-outline text-red-500 mt-0 border-red-500 mx-auto">Block</h1>
7072
<h1 class="mx-auto mt-2 text-sm text-gray-600">Don't suggest this user and stop notifications</h1>
7173
</div>
7274
</div>
@@ -100,6 +102,7 @@ export default {
100102
likeClicked: false,
101103
superLikeClicked: false,
102104
},
105+
reportReason: '',
103106
}),
104107
methods: {
105108
preferences() {
@@ -148,8 +151,15 @@ export default {
148151
},
149152
saveSingleChoice(...args) {
150153
const [key, value] = args;
151-
console.log(key);
152-
console.log(value);
154+
if (key === 'report') {
155+
this[key] = value;
156+
}
157+
},
158+
async makeReport() {
159+
await this.$http.post(`/profile/report/${this.user.id}`, { reason: this.report, details: '' });
160+
},
161+
async block() {
162+
return true;
153163
},
154164
},
155165
computed: {

0 commit comments

Comments
 (0)