Add followed & banned status to search result in backend and frontend

This commit is contained in:
Marco Realacci 2022-12-10 01:23:38 +01:00
parent 931bf8b79f
commit 25be953a11
2 changed files with 8 additions and 3 deletions

View file

@ -5,7 +5,7 @@ export default {
data: function() {
return {
errorMsg: "aaa",
user_followed: this.post_followed,
user_followed: this.followed,
user_banned: this.banned,
myself: this.my_id == this.user_id,
show_post_form: false,
@ -43,7 +43,7 @@ export default {
unban() {
this.$axios.delete("/users/" + this.my_id + "/bans/" + this.user_id)
.then(response => {
this.user_banned = true
this.user_banned = false
this.$emit('updateInfo')
})
.catch(error => alert(error.toString()));

View file

@ -76,7 +76,12 @@ export default {
</div>
<div id="main-content" v-for="item of stream_data">
<UserCard :user_id="item.user_id" :name="item.name" :my_id="my_id" />
<UserCard
:user_id="item.user_id"
:name="item.name"
:followed="item.followed"
:banned="item.banned"
:my_id="my_id" />
</div>
<LoadingSpinner :loading="loading" /><br />