From 2cd389e2290e09c1d5e0cdf66fb25f7d86b33b5b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 20 Jul 2019 19:56:20 -0600 Subject: [PATCH] Update PostMenu, add missing methods --- resources/assets/js/components/PostMenu.vue | 34 +++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/PostMenu.vue b/resources/assets/js/components/PostMenu.vue index b219978ad..20a7472a9 100644 --- a/resources/assets/js/components/PostMenu.vue +++ b/resources/assets/js/components/PostMenu.vue @@ -12,8 +12,8 @@ Report - Mute Profile - Block Profile + Mute Profile + Block Profile @@ -187,6 +187,36 @@ }); break; } + }, + + muteProfile(status) { + if($('body').hasClass('loggedIn') == false) { + return; + } + + axios.post('/i/mute', { + type: 'user', + item: status.account.id + }).then(res => { + swal('Success', 'You have successfully muted ' + status.account.acct, 'success'); + }).catch(err => { + swal('Error', 'Something went wrong. Please try again later.', 'error'); + }); + }, + + blockProfile(status) { + if($('body').hasClass('loggedIn') == false) { + return; + } + + axios.post('/i/block', { + type: 'user', + item: status.account.id + }).then(res => { + swal('Success', 'You have successfully blocked ' + status.account.acct, 'success'); + }).catch(err => { + swal('Error', 'Something went wrong. Please try again later.', 'error'); + }); } } }