From 02237845b564baf5e20bcb9fd13927e2cb97bc5b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 20 Oct 2021 04:17:46 -0600 Subject: [PATCH] Update Profile component, improve error messages when block/mute limit reached --- resources/assets/js/components/Profile.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/Profile.vue b/resources/assets/js/components/Profile.vue index e4c48fccb..187ac9ad5 100644 --- a/resources/assets/js/components/Profile.vue +++ b/resources/assets/js/components/Profile.vue @@ -1078,7 +1078,11 @@ this.$refs.visitorContextMenu.hide(); swal('Success', 'You have successfully muted ' + this.profile.acct, 'success'); }).catch(err => { - swal('Error', 'Something went wrong. Please try again later.', 'error'); + if(err.response.status == 422) { + swal('Error', err.response.data.error, 'error'); + } else { + swal('Error', 'Something went wrong. Please try again later.', 'error'); + } }); }, @@ -1113,7 +1117,11 @@ this.$refs.visitorContextMenu.hide(); swal('Success', 'You have successfully blocked ' + this.profile.acct, 'success'); }).catch(err => { - swal('Error', 'Something went wrong. Please try again later.', 'error'); + if(err.response.status == 422) { + swal('Error', err.response.data.error, 'error'); + } else { + swal('Error', 'Something went wrong. Please try again later.', 'error'); + } }); },